@@ -6,9 +6,9 @@ const prettierOptions = JSON.parse(
66) ;
77
88module . exports = {
9- parser : 'babel -eslint' ,
10- extends : [ 'airbnb' , 'prettier' , 'prettier/react' ] ,
11- plugins : [ 'prettier' , 'redux-saga' , 'react' , 'react-hooks' , 'jsx-a11y' ] ,
9+ parser : '@typescript -eslint/parser ' ,
10+ extends : [ 'airbnb-typescript ' , 'prettier' , 'prettier/react' ] ,
11+ plugins : [ 'prettier' , 'redux-saga' , 'react' , 'react-hooks' , 'jsx-a11y' , '@typescript-eslint' ] ,
1212 env : {
1313 jest : true ,
1414 browser : true ,
@@ -21,11 +21,37 @@ module.exports = {
2121 ecmaFeatures : {
2222 jsx : true ,
2323 } ,
24+ project : './tsconfig.eslint.json' ,
2425 } ,
2526 rules : {
27+ 'jsx-no-lambda' : 0 ,
28+ 'semi' : [ 2 , 'always' ] ,
29+ '@typescript-eslint/interface-name-prefix' : 0 ,
30+ '@typescript-eslint/no-empty-interface' : 0 ,
31+ 'object-shorthand' : [ 0 , 'never' ] ,
32+ 'quotes' : [ 2 , 'single' ] ,
33+ '@typescript-eslint/no-var-requires' : 0 ,
34+ 'member-ordering' : 0 ,
35+ 'object-literal-sort-keys' : 0 ,
36+ 'no-shadowed-variable' : 0 ,
37+ 'no-consecutive-blank-lines' : 0 ,
38+ 'no-string-literal' : 0 ,
39+ 'jsx-no-multiline-js' : 0 ,
40+ 'jsx-boolean-value' : 0 ,
41+ 'arrow-parens' : 0 ,
42+ 'no-implicit-dependencies' : 0 ,
43+ 'no-submodule-imports' : 0 ,
44+ 'no-case-declarations' : 1 ,
45+ '@typescript-eslint/no-empty-function' : 0 ,
46+ '@typescript-eslint/ban-ts-ignore' : 1 ,
47+ '@typescript-eslint/indent' : 0 ,
48+ 'jsx-alignment' : 0 ,
49+ 'jsx-wrap-multiline' : 0 ,
50+ '@typescript-eslint/camelcase' : 0 ,
2651 'prettier/prettier' : [ 'error' , prettierOptions ] ,
2752 'arrow-body-style' : [ 2 , 'as-needed' ] ,
2853 'class-methods-use-this' : 0 ,
54+ 'import/order' : 0 ,
2955 'import/imports-first' : 0 ,
3056 'import/newline-after-import' : 0 ,
3157 'import/no-dynamic-require' : 0 ,
@@ -34,6 +60,8 @@ module.exports = {
3460 'import/no-unresolved' : 2 ,
3561 'import/no-webpack-loader-syntax' : 0 ,
3662 'import/prefer-default-export' : 0 ,
63+ 'import/no-cycle' : 1 ,
64+ 'no-param-reassign' : 1 ,
3765 indent : [
3866 2 ,
3967 2 ,
@@ -60,7 +88,6 @@ module.exports = {
6088 'newline-per-chained-call' : 0 ,
6189 'no-confusing-arrow' : 0 ,
6290 'no-console' : 1 ,
63- 'no-unused-vars' : 2 ,
6491 'no-use-before-define' : 0 ,
6592 'prefer-template' : 2 ,
6693 'react/destructuring-assignment' : 0 ,
@@ -70,7 +97,9 @@ module.exports = {
7097 'react/jsx-first-prop-new-line' : [ 2 , 'multiline' ] ,
7198 'react/jsx-filename-extension' : 0 ,
7299 'react/jsx-no-target-blank' : 0 ,
100+ 'react/jsx-props-no-spreading' : 0 ,
73101 'react/jsx-uses-vars' : 2 ,
102+ 'react/prop-types' : 0 ,
74103 'react/require-default-props' : 0 ,
75104 'react/require-extension' : 0 ,
76105 'react/self-closing-comp' : 0 ,
@@ -80,10 +109,17 @@ module.exports = {
80109 'require-yield' : 0 ,
81110 } ,
82111 settings : {
112+ 'import/parsers' : {
113+ '@typescript-eslint/parser' : [ '.ts' , '.tsx' ] ,
114+ } ,
83115 'import/resolver' : {
84116 webpack : {
85117 config : './internals/webpack/webpack.prod.babel.js' ,
86118 } ,
119+ 'typescript' : {
120+ 'alwaysTryTypes' : true , // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
121+ 'directory' : './tsconfig.json' ,
122+ } ,
87123 } ,
88124 } ,
89125} ;
0 commit comments