Upgrade configuration to be compatible with eslint 6 and latest changes in the eslint-typescript

This commit is contained in:
ErickSkrauch 2019-12-16 13:59:31 +03:00
parent 4ba3f330a2
commit a6667fb421
No known key found for this signature in database
GPG Key ID: 669339FCBB30EE0E
3 changed files with 1348 additions and 1412 deletions

View File

@ -30,7 +30,7 @@
"@babel/core": "^7.4.5", "@babel/core": "^7.4.5",
"@babel/preset-env": "^7.4.4", "@babel/preset-env": "^7.4.4",
"@babel/preset-typescript": "^7.3.3", "@babel/preset-typescript": "^7.3.3",
"@elyby/eslint-plugin": "^0.1.0", "@elyby/eslint-plugin": "^0.2.0",
"@types/eslint": "^4.16.6", "@types/eslint": "^4.16.6",
"@types/estree": "^0.0.39", "@types/estree": "^0.0.39",
"@types/node": "^12.0.2", "@types/node": "^12.0.2",
@ -39,10 +39,10 @@
"typescript": "^3.4.5" "typescript": "^3.4.5"
}, },
"peerDependencies": { "peerDependencies": {
"@typescript-eslint/eslint-plugin": "^1.9.1-alpha.12", "@typescript-eslint/eslint-plugin": "^2.11.0",
"@typescript-eslint/parser": "^1.9.0", "@typescript-eslint/parser": "^2.11.0",
"eslint": ">=5.16.0", "eslint": "^6.0.0",
"eslint-plugin-react": "^7.13.0", "eslint-plugin-react": "^7.13.0",
"eslint-plugin-react-hooks": "^1.6.0" "eslint-plugin-react-hooks": "^1.6.0 | ^2.0.0"
} }
} }

View File

@ -5,7 +5,7 @@ const config: Linter.Config = {
// @ts-ignore // @ts-ignore
plugins: [ plugins: [
'@typescript-eslint', '@typescript-eslint/eslint-plugin',
], ],
overrides: [ overrides: [
@ -24,35 +24,39 @@ const config: Linter.Config = {
'react/prop-types': 'off', 'react/prop-types': 'off',
'@typescript-eslint/adjacent-overload-signatures': 'error', '@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/array-type': ['error', 'generic'], '@typescript-eslint/array-type': ['error', {
default: 'generic',
readonly: 'generic',
}],
'@typescript-eslint/camelcase': 'error', '@typescript-eslint/camelcase': 'error',
'@typescript-eslint/class-name-casing': 'error', '@typescript-eslint/class-name-casing': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/explicit-member-accessibility': 'error', '@typescript-eslint/explicit-member-accessibility': 'error',
'@typescript-eslint/func-call-spacing': 'error', '@typescript-eslint/func-call-spacing': 'error',
'@typescript-eslint/indent': 'error', '@typescript-eslint/indent': 'error',
'@typescript-eslint/interface-name-prefix': ['error', 'never'], '@typescript-eslint/interface-name-prefix': ['error', 'never'],
'@typescript-eslint/member-delimiter-style': 'error', '@typescript-eslint/member-delimiter-style': 'error',
'@typescript-eslint/no-angle-bracket-type-assertion': 'error',
'@typescript-eslint/no-array-constructor': 'error', '@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-empty-interface': 'error', '@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-extra-parens': ['warn', 'all', { '@typescript-eslint/no-extra-parens': ['warn', 'all', {
nestedBinaryExpressions: false, nestedBinaryExpressions: false,
ignoreJSX: 'multi-line', ignoreJSX: 'multi-line',
}], }],
'@typescript-eslint/no-inferrable-types': 'error', '@typescript-eslint/no-inferrable-types': ['error', {
ignoreParameters: true,
}],
'@typescript-eslint/no-misused-new': 'error', '@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'error', '@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-object-literal-type-assertion': 'error',
'@typescript-eslint/no-parameter-properties': 'error', '@typescript-eslint/no-parameter-properties': 'error',
'@typescript-eslint/no-triple-slash-reference': 'error',
'@typescript-eslint/no-unused-vars': 'error', '@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-use-before-define': 'error', '@typescript-eslint/no-use-before-define': 'error',
'@typescript-eslint/no-useless-constructor': 'warn', '@typescript-eslint/no-useless-constructor': 'warn',
'@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-for-of': 'warn', '@typescript-eslint/prefer-for-of': 'warn',
'@typescript-eslint/prefer-interface': 'error',
'@typescript-eslint/prefer-namespace-keyword': 'error', '@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/semi': 'error', '@typescript-eslint/semi': 'error',
'@typescript-eslint/triple-slash-reference': 'error',
'@typescript-eslint/type-annotation-spacing': 'error', '@typescript-eslint/type-annotation-spacing': 'error',
}, },
}, },

2732
yarn.lock

File diff suppressed because it is too large Load Diff