@@ -10,9 +10,7 @@ const js = {
1010 ] ,
1111 extends : [
1212 'eslint:recommended' ,
13- 'plugin:prettier/recommended' ,
14- 'plugin:@typescript-eslint/recommended' ,
15- 'plugin:@typescript-eslint/recommended-requiring-type-checking'
13+ 'plugin:prettier/recommended'
1614 ] ,
1715 rules : {
1816 "jest/no-focused-tests" : "error" ,
@@ -23,24 +21,37 @@ const js = {
2321 } ,
2422}
2523
24+ const ts = {
25+ ...js ,
26+ files : [ "**/*.ts" , "**/*.tsx" ] ,
27+ parser : '@typescript-eslint/parser' ,
28+ parserOptions : {
29+ project : './tsconfig.json'
30+ } ,
31+ plugins : [ ...js . plugins , '@typescript-eslint' ] ,
32+ extends : [
33+ ...js . extends ,
34+ 'plugin:@typescript-eslint/recommended' ,
35+ 'plugin:@typescript-eslint/recommended-requiring-type-checking'
36+ ]
37+ }
38+
39+ const tsTest = {
40+ ...ts ,
41+ files : [ "**/*.test.ts" , "**/*.test.tsx" ] ,
42+ rules : {
43+ ...ts . rules ,
44+ // Allow test matches to fail and cause an error in the test
45+ '@typescript-eslint/no-non-null-assertion' : 'off' ,
46+ }
47+ }
48+
2649module . exports = {
2750 ...js ,
2851 ignorePatterns : [ '*.d.ts' ] ,
2952 extends : [
3053 'eslint:recommended' ,
3154 'plugin:prettier/recommended' ,
3255 ] ,
33- overrides : [ {
34- files : [ "**/*.ts" , "**/*.tsx" ] ,
35- parser : '@typescript-eslint/parser' ,
36- parserOptions : {
37- project : './tsconfig.json'
38- } ,
39- plugins : [ ...js . plugins , '@typescript-eslint' ] ,
40- extends : [
41- ...js . extends ,
42- 'plugin:@typescript-eslint/recommended' ,
43- 'plugin:@typescript-eslint/recommended-requiring-type-checking'
44- ]
45- } ]
56+ overrides : [ ts , tsTest ]
4657}
0 commit comments