Proper TSLint Extends (#4635)

This commit is contained in:
Felix Becker 2019-06-21 15:11:45 +02:00 committed by GitHub
parent dbb9963475
commit c8472a256e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 37 additions and 32 deletions

5
.github/CODEOWNERS vendored
View File

@ -58,7 +58,7 @@
/.gitmodules @beyang
/.gitattributes @beyang
/.yarnrc @felixfbecker
/.eslintrc.js @felixfbecker
.eslintrc.js @felixfbecker
/CHANGELOG.md @beyang
/pkg/httputil @beyang
/pkg/diskcache @beyang
@ -82,7 +82,8 @@
/.mailmap @beyang
/tsconfig.json @felixfbecker
/jest.config.base.js @felixfbecker
/tslint.json @felixfbecker
tslint.json @felixfbecker
tslint.config.js @felixfbecker
/enterprise/cmd @beyang
/enterprise/pkg @beyang
/enterprise @beyang

View File

@ -1,5 +1,5 @@
{
"extends": ["../tslint.json"],
"extends": ["../tslint.config.js"],
"linterOptions": { "exclude": ["node_modules/**", "**/*.json", "coverage/**"] },
"rules": {
"deprecation": {

View File

@ -346,7 +346,7 @@ describe('registerHoverContributions()', () => {
altAction: undefined,
}
it.only('shows goToDefinition (non-preloaded) when the definition is loading', async () =>
it('shows goToDefinition (non-preloaded) when the definition is loading', async () =>
expect(
getHoverActions({
'goToDefinition.showLoading': true,

View File

@ -1,5 +1,5 @@
{
"extends": ["../tslint.json"],
"extends": ["../tslint.config.js"],
"linterOptions": { "exclude": ["node_modules/**", "coverage/**"] },
"rulesDirectory": "dev/tslint",
"rules": {

30
tslint.config.js Normal file
View File

@ -0,0 +1,30 @@
// @ts-nocheck
const baseConfig = require('@sourcegraph/tslint-config')
module.exports = {
extends: ['@sourcegraph/tslint-config'],
linterOptions: { exclude: ['node_modules/**'] },
rules: {
'await-promise': false,
'import-blacklist': [true, 'highlight.js', 'marked'],
ban: [
true,
...baseConfig.rules.ban,
{ name: ['assert', 'strictEqual'], message: 'Use jest matchers instead.' },
{ name: ['assert', 'deepStrictEqual'], message: 'Use jest matchers instead.' },
{ name: ['test', 'only'], message: "Don't commit 'only' test directives." },
],
'jsx-ban-elements': [
true,
[
'^form$',
'Use the Form component in src/components/Form.tsx instead of the native HTML form element to get proper form validation feedback',
],
[
'^select$',
'Use the Select component in src/components/Select.tsx instead of the native HTML select element for proper cross-browser styling',
],
],
},
}

View File

@ -1,26 +0,0 @@
{
"extends": ["@sourcegraph/tslint-config"],
"linterOptions": { "exclude": ["node_modules/**"] },
"rules": {
"await-promise": false,
"import-blacklist": [true, "highlight.js", "marked"],
"ban": [
true,
{ "name": ["assert", "strictEqual"], "message": "Use jest matchers instead." },
{ "name": ["assert", "deepStrictEqual"], "message": "Use jest matchers instead." },
{ "name": ["describe", "only"], "message": "Don't commit 'only' test directives." },
{ "name": ["test", "only"], "message": "Don't commit 'only' test directives." }
],
"jsx-ban-elements": [
true,
[
"^form$",
"Use the Form component in src/components/Form.tsx instead of the native HTML form element to get proper form validation feedback"
],
[
"^select$",
"Use the Select component in src/components/Select.tsx instead of the native HTML select element for proper cross-browser styling"
]
]
}
}

View File

@ -1,5 +1,5 @@
{
"extends": ["../tslint.json"],
"extends": ["../tslint.config.js"],
"linterOptions": { "exclude": ["node_modules/**", "coverage/**"] },
"rules": {
"await-promise": false