Skip to content

Commit

Permalink
ESLint: enable all TS rules that require running compiler (#2388)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov authored Jan 24, 2020
1 parent e90d827 commit d5a1ba8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
38 changes: 21 additions & 17 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@ rules:
overrides:
- files: '**/*.ts'
parser: '@typescript-eslint/parser'
parserOptions:
tsconfigRootDir: './src/'
project: ['tsconfig.json']
plugins:
- '@typescript-eslint'
rules:
Expand All @@ -447,7 +450,7 @@ overrides:
# https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules
'@typescript-eslint/adjacent-overload-signatures': error
'@typescript-eslint/array-type': [error, { default: generic }]
'@typescript-eslint/await-thenable': off # TODO error
'@typescript-eslint/await-thenable': error
'@typescript-eslint/ban-ts-ignore': error
'@typescript-eslint/ban-types': error
'@typescript-eslint/consistent-type-assertions':
Expand All @@ -462,39 +465,40 @@ overrides:
'@typescript-eslint/no-explicit-any': off # TODO error
'@typescript-eslint/no-extra-non-null-assertion': error
'@typescript-eslint/no-extraneous-class': off # TODO consider
'@typescript-eslint/no-floating-promises': off # TODO error
'@typescript-eslint/no-floating-promises': error
'@typescript-eslint/no-for-in-array': error
'@typescript-eslint/no-implied-eval': off # TODO error
'@typescript-eslint/no-implied-eval': error
'@typescript-eslint/no-inferrable-types':
[error, { ignoreParameters: true, ignoreProperties: true }]
'@typescript-eslint/no-misused-new': error
'@typescript-eslint/no-misused-promises': off # TODO error
'@typescript-eslint/no-misused-promises': error
'@typescript-eslint/no-namespace': error
'@typescript-eslint/no-non-null-assertion': off # TODO error
'@typescript-eslint/no-non-null-assertion': error
'@typescript-eslint/no-parameter-properties': error
'@typescript-eslint/no-require-imports': error
'@typescript-eslint/no-this-alias': error
'@typescript-eslint/no-throw-literal': off # TODO error
'@typescript-eslint/no-throw-literal': error
'@typescript-eslint/no-type-alias': off # TODO consider
'@typescript-eslint/no-unnecessary-condition': off # TODO error
'@typescript-eslint/no-unnecessary-qualifier': off # TODO error
'@typescript-eslint/no-unnecessary-condition': error
'@typescript-eslint/no-unnecessary-qualifier': error
'@typescript-eslint/no-unnecessary-type-arguments': off # TODO error
'@typescript-eslint/no-unnecessary-type-assertion': off # TODO error
'@typescript-eslint/no-unnecessary-type-assertion': error
'@typescript-eslint/no-unused-vars-experimental': off
'@typescript-eslint/no-var-requires': error
'@typescript-eslint/prefer-for-of': off # TODO switch to error after TS migration
'@typescript-eslint/prefer-function-type': error
'@typescript-eslint/prefer-includes': off # TODO switch to error after IE11 drop
'@typescript-eslint/prefer-namespace-keyword': error
'@typescript-eslint/prefer-nullish-coalescing': off # TODO error
'@typescript-eslint/prefer-nullish-coalescing': error
'@typescript-eslint/prefer-optional-chain': error
'@typescript-eslint/prefer-readonly': off # TODO error
'@typescript-eslint/prefer-regexp-exec': off # TODO error
'@typescript-eslint/prefer-readonly': error
'@typescript-eslint/prefer-regexp-exec': error
'@typescript-eslint/prefer-string-starts-ends-with': off # TODO switch to error after IE11 drop
'@typescript-eslint/promise-function-async': off
'@typescript-eslint/require-array-sort-compare': off # TODO error
'@typescript-eslint/restrict-plus-operands': off # TODO [error, { checkCompoundAssignments: true }]
'@typescript-eslint/restrict-template-expressions': off # TODO error
'@typescript-eslint/require-array-sort-compare': error
'@typescript-eslint/restrict-plus-operands':
[error, { checkCompoundAssignments: true }]
'@typescript-eslint/restrict-template-expressions': error
'@typescript-eslint/strict-boolean-expressions': off # TODO consider
'@typescript-eslint/triple-slash-reference': error
'@typescript-eslint/typedef': off
Expand All @@ -520,8 +524,8 @@ overrides:
'@typescript-eslint/no-unused-vars':
[error, { vars: all, args: all, argsIgnorePattern: '^_' }]
'@typescript-eslint/no-useless-constructor': error
'@typescript-eslint/require-await': off # TODO
'@typescript-eslint/return-await': off # TODO
'@typescript-eslint/require-await': error
'@typescript-eslint/return-await': error

# Disable for JS, Flow and TS
'@typescript-eslint/no-magic-numbers': off
Expand Down
3 changes: 1 addition & 2 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts"]
}
}

0 comments on commit d5a1ba8

Please sign in to comment.