Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update all TypeScript rules, remove deprecated rules #27

Merged
merged 1 commit into from
Feb 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 36 additions & 8 deletions config/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,21 @@ module.exports = {
// Checked by TypeScript - `strictNullChecks`
'no-undef': 'off',
// Checked by TypeScript
'no-dupe-class-members': 'off',
// Checked by TypeScript
'no-redeclare': 'off',
// Checked by TypeScript
'import/no-unresolved': 'off',

// Rules from @typescript-eslint/eslint-plugin
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/ban-ts-ignore': 'error',
'@typescript-eslint/await-thenable': 'off', // Requires type information
'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/class-name-casing': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/consistent-type-definitions': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/interface-name-prefix': 'error',
'@typescript-eslint/member-delimiter-style': ['error', {
'multiline': {
'delimiter': 'semi',
Expand All @@ -55,37 +52,61 @@ module.exports = {
},
}],
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/naming-convention': 'off', // Requires type information
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-extra-non-null-assertion': 'error',
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/no-floating-promises': 'off', // Requires type information
'@typescript-eslint/no-for-in-array': 'off', // Requires type information
'@typescript-eslint/no-implied-eval': 'off', // Requires type information
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-misused-promises': 'off', // Requires type information
'@typescript-eslint/no-namespace': ['error', { 'allowDefinitionFiles': true }],
'@typescript-eslint/no-non-null-asserted-optional-chain': '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', // Requires type information
'@typescript-eslint/no-type-alias': 'off',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off', // Requires type information
'@typescript-eslint/no-unnecessary-condition': 'off', // Requires type information
'@typescript-eslint/no-unnecessary-qualifier': 'off', // Requires type information
'@typescript-eslint/no-unnecessary-type-arguments': 'off', // Requires type information
'@typescript-eslint/no-unnecessary-type-assertion': 'off', // Requires type information
'@typescript-eslint/no-unused-vars-experimental': 'off', // Requires type information
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-as-const': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-includes': 'off', // Requires type information
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'off', // Requires type information
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-readonly': 'off', // Requires type information
'@typescript-eslint/prefer-regexp-exec': 'off', // Requires type information
'@typescript-eslint/prefer-string-starts-ends-with': 'off', // Requires type information
'@typescript-eslint/promise-function-async': 'off', // Requires type information
'@typescript-eslint/require-array-sort-compare': 'off', // Requires type information
'@typescript-eslint/restrict-plus-operands': 'off', // Requires type information
'@typescript-eslint/restrict-template-expressions': 'off', // Requires type information
'@typescript-eslint/strict-boolean-expressions': 'off', // Requires type information
'@typescript-eslint/switch-exhaustiveness-check': 'off', // Requires type information
'@typescript-eslint/triple-slash-reference': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/typedef': 'off',
'@typescript-eslint/unbound-method': 'off', // Requires type information
'@typescript-eslint/unified-signatures': 'error',

// "Extension Rules" from @typescript-eslint/eslint-plugin
'@typescript-eslint/brace-style': 'error',
'brace-style': 'off',

'@typescript-eslint/camelcase': 'error',
'camelcase': 'off',
'@typescript-eslint/comma-spacing': 'error',
'comma-spacing': 'off',

'@typescript-eslint/default-param-last': 'error',
'default-param-last': 'off',
Expand All @@ -99,6 +120,9 @@ module.exports = {
'@typescript-eslint/no-array-constructor': 'error',
'no-array-constructor': 'off',

'@typescript-eslint/no-dupe-class-members': 'error',
'no-dupe-class-members': 'off',

'@typescript-eslint/no-empty-function': 'error',
'no-empty-function': 'off',

Expand Down Expand Up @@ -126,6 +150,10 @@ module.exports = {
'@typescript-eslint/quotes': ['error', 'single', { 'avoidEscape': true, 'allowTemplateLiterals': true }],
'quotes': 'off',

'@typescript-eslint/require-await': 'off', // Requires type information
Gudahtt marked this conversation as resolved.
Show resolved Hide resolved

'@typescript-eslint/return-await': 'off', // Requires type information

'@typescript-eslint/semi': ['error', 'always'],
'semi': 'off',

Expand Down