11module . exports = {
2- parser : '@typescript-eslint/parser' ,
3- parserOptions : {
4- project : 'tsconfig.json' ,
5- sourceType : 'module' ,
6- } ,
7- plugins : [ '@typescript-eslint/eslint-plugin' , 'prettier' ] ,
8- extends : [
9- 'eslint:recommended' ,
10- 'plugin:@typescript-eslint/recommended' ,
11- 'plugin:import/errors' ,
12- 'plugin:import/warnings' ,
13- 'plugin:import/typescript' ,
14- 'plugin:prettier/recommended' ,
15- ] ,
16- root : true ,
17- env : {
18- node : true ,
19- jest : true ,
20- } ,
21- ignorePatterns : [ '.eslintrc.js' ] ,
22- rules : {
23- 'no-param-reassign' : [ 'error' ] ,
24- 'prettier/prettier' : 'error' ,
25- 'linebreak-style' : [ 'error' , 'unix' ] ,
26- 'arrow-body-style' : [
27- 'error' ,
28- 'as-needed' ,
29- {
30- requireReturnForObjectLiteral : false ,
31- } ,
2+ parser : '@typescript-eslint/parser' ,
3+ parserOptions : {
4+ project : 'tsconfig.json' ,
5+ sourceType : 'module' ,
6+ } ,
7+ plugins : [ '@typescript-eslint/eslint-plugin' , 'prettier' ] ,
8+ extends : [
9+ 'eslint:recommended' ,
10+ 'plugin:@typescript-eslint/recommended' ,
11+ 'plugin:import/errors' ,
12+ 'plugin:import/warnings' ,
13+ 'plugin:import/typescript' ,
14+ 'plugin:prettier/recommended' ,
3215 ] ,
33- curly : [ 'error' , 'all' ] ,
34- 'no-implicit-coercion' : [ 'error' ] ,
35- 'spaced-comment' : [ 'error' , 'always' ] ,
36- eqeqeq : [ 'error' , 'always' ] ,
37- 'prefer-template' : 'error' ,
38- 'no-useless-concat' : 'error' ,
39- 'prefer-destructuring' : [
40- 'error' ,
41- {
42- VariableDeclarator : {
43- array : false ,
44- object : true ,
16+ root : true ,
17+ env : {
18+ node : true ,
19+ jest : true ,
20+ } ,
21+ ignorePatterns : [ '.eslintrc.js' ] ,
22+ rules : {
23+ 'no-param-reassign' : [ 'error' ] ,
24+ 'prettier/prettier' : 'error' ,
25+ 'linebreak-style' : [ 'error' , 'unix' ] ,
26+ 'arrow-body-style' : [
27+ 'error' ,
28+ 'as-needed' ,
29+ {
30+ requireReturnForObjectLiteral : false ,
4531 } ,
46- AssignmentExpression : {
47- array : false ,
48- object : true ,
32+ ] ,
33+ curly : [ 'error' , 'all' ] ,
34+ 'no-implicit-coercion' : [ 'error' ] ,
35+ 'spaced-comment' : [ 'error' , 'always' ] ,
36+ eqeqeq : [ 'error' , 'always' ] ,
37+ 'prefer-template' : 'error' ,
38+ 'no-useless-concat' : 'error' ,
39+ 'prefer-destructuring' : [
40+ 'error' ,
41+ {
42+ VariableDeclarator : {
43+ array : false ,
44+ object : true ,
45+ } ,
46+ AssignmentExpression : {
47+ array : false ,
48+ object : true ,
49+ } ,
4950 } ,
50- } ,
51- {
52- enforceForRenamedProperties : false ,
53- } ,
54- ] ,
55- 'no-restricted-imports' : [
56- 'error' ,
57- {
58- patterns : [ '../*' ] ,
59- } ,
60- ] ,
61- 'import/extensions' : [
62- 'error' ,
63- 'ignorePackages' ,
64- {
65- ts : 'never' ,
66- tsx : 'never' ,
67- } ,
68- ] ,
69- 'import/no-extraneous-dependencies' : [ 'error' , { devDependencies : true } ] ,
70- 'import/order' : [
71- 'error' ,
72- {
73- 'newlines-between' : 'always' ,
74- groups : [ 'builtin' , 'external' , 'parent' , 'sibling' , 'index' ] ,
75- pathGroups : [
76- {
77- pattern : 'src/**' ,
78- group : 'parent' ,
79- position : 'after' ,
51+ {
52+ enforceForRenamedProperties : false ,
53+ } ,
54+ ] ,
55+ 'no-restricted-imports' : [
56+ 'error' ,
57+ {
58+ patterns : [ '../*' ] ,
59+ } ,
60+ ] ,
61+ 'import/extensions' : [
62+ 'error' ,
63+ 'ignorePackages' ,
64+ {
65+ ts : 'never' ,
66+ tsx : 'never' ,
67+ } ,
68+ ] ,
69+ 'import/no-extraneous-dependencies' : [ 'error' , { devDependencies : true } ] ,
70+ 'import/order' : [
71+ 'error' ,
72+ {
73+ 'newlines-between' : 'always' ,
74+ groups : [ 'builtin' , 'external' , 'parent' , 'sibling' , 'index' ] ,
75+ pathGroups : [
76+ {
77+ pattern : 'src/**' ,
78+ group : 'parent' ,
79+ position : 'after' ,
80+ } ,
81+ ] ,
82+ } ,
83+ ] ,
84+ 'import/newline-after-import' : 'error' ,
85+ '@typescript-eslint/interface-name-prefix' : 'off' ,
86+ '@typescript-eslint/no-explicit-any' : 'error' ,
87+ '@typescript-eslint/explicit-function-return-type' : 'off' ,
88+ '@typescript-eslint/explicit-module-boundary-types' : 'off' ,
89+ '@typescript-eslint/ban-types' : [ 'error' ] ,
90+ "@typescript-eslint/no-shadow" : [ "error" ] ,
91+ '@typescript-eslint/naming-convention' : [
92+ 'error' ,
93+ {
94+ selector : 'default' ,
95+ format : [ 'camelCase' ] ,
96+ } ,
97+ {
98+ selector : [ 'enumMember' , 'variable' ] ,
99+ format : [ 'camelCase' , 'PascalCase' , 'UPPER_CASE' ] ,
100+ } ,
101+ {
102+ selector : 'parameter' ,
103+ format : [ 'camelCase' ] ,
104+ leadingUnderscore : 'allow' ,
105+ modifiers : [ 'unused' ] ,
106+ } ,
107+ {
108+ selector : 'objectLiteralProperty' ,
109+ filter : {
110+ // Regular expression for BEM classnames
111+ // Source: https://medium.com/takeaway-tech/the-search-for-a-regex-to-match-hyphenated-bem-css-class-names-5f8b66cc2bd9
112+ regex : '^[a-z]([a-z0-9-]+)?(__([a-z0-9]+-?)+)?(--([a-z0-9]+-?)+){0,2}$' ,
113+ match : true ,
80114 } ,
81- ] ,
82- } ,
83- ] ,
84- 'import/newline-after-import' : 'error' ,
85- '@typescript-eslint/interface-name-prefix' : 'off' ,
86- '@typescript-eslint/no-explicit-any' : 'error' ,
87- '@typescript-eslint/explicit-function-return-type' : 'off' ,
88- '@typescript-eslint/explicit-module-boundary-types' : 'off' ,
89- '@typescript-eslint/ban-types' : [ 'error' ] ,
90- "@typescript-eslint/no-shadow" : [ "error" ] ,
91- '@typescript-eslint/naming-convention' : [
92- 'error' ,
93- {
94- selector : 'default' ,
95- format : [ 'camelCase' ] ,
96- } ,
97- {
98- selector : [ 'enumMember' , 'variable' ] ,
99- format : [ 'camelCase' , 'PascalCase' , 'UPPER_CASE' ] ,
100- } ,
101- {
102- selector : 'parameter' ,
103- format : [ 'camelCase' ] ,
104- leadingUnderscore : 'allow' ,
105- modifiers : [ 'unused' ] ,
106- } ,
107- {
108- selector : 'objectLiteralProperty' ,
109- filter : {
110- // Regular expression for BEM classnames
111- // Source: https://medium.com/takeaway-tech/the-search-for-a-regex-to-match-hyphenated-bem-css-class-names-5f8b66cc2bd9
112- regex : '^[a-z]([a-z0-9-]+)?(__([a-z0-9]+-?)+)?(--([a-z0-9]+-?)+){0,2}$' ,
113- match : true ,
115+ format : null ,
114116 } ,
115- format : null ,
116- } ,
117- {
118- selector : 'typeLike' ,
119- format : [ 'PascalCase' ] ,
120- } ,
121- {
122- selector : 'typeProperty' ,
123- format : [ 'snake_case' , 'camelCase' ] ,
124- } ,
125- ] ,
126- } ,
127- settings : {
128- 'import/resolver' : {
129- node : {
130- paths : [ './' ] ,
131- extensions : [ '.ts' ] ,
117+ {
118+ selector : 'typeLike' ,
119+ format : [ 'PascalCase' ] ,
120+ } ,
121+ {
122+ selector : 'typeProperty' ,
123+ format : [ 'snake_case' , 'camelCase' ] ,
124+ } ,
125+ ] ,
126+ } ,
127+ settings : {
128+ 'import/resolver' : {
129+ node : {
130+ paths : [ './' ] ,
131+ extensions : [ '.ts' ] ,
132+ } ,
133+ typescript : { } // this loads <rootdir>/tsconfig.json to eslint
132134 } ,
133- typescript : { } // this loads <rootdir>/tsconfig.json to eslint
134135 } ,
135- } ,
136- } ;
136+ } ;
0 commit comments