1
1
// @ts -check
2
2
3
3
import eslint from '@eslint/js' ;
4
+ import eslintPluginJest from 'eslint-plugin-jest' ;
5
+ import globals from 'globals' ;
4
6
import tseslint from 'typescript-eslint' ;
5
7
8
+ import bestPractices from 'eslint-config-airbnb-base/rules/best-practices' ;
9
+ import errors from 'eslint-config-airbnb-base/rules/errors' ;
10
+ import es6 from 'eslint-config-airbnb-base/rules/es6' ;
11
+ import node from 'eslint-config-airbnb-base/rules/node' ;
12
+ import strict from 'eslint-config-airbnb-base/rules/strict' ;
13
+ import style from 'eslint-config-airbnb-base/rules/style' ;
14
+ import variables from 'eslint-config-airbnb-base/rules/variables' ;
15
+
16
+ const bestPracticesRules = bestPractices . rules ;
17
+ const errorsRules = errors . rules ;
18
+ const es6Rules = es6 . rules ;
19
+ const nodeRules = node . rules ;
20
+ const strictRules = strict . rules ;
21
+ const styleRules = style . rules ;
22
+ const variablesRules = variables . rules ;
23
+
6
24
export default tseslint . config (
7
25
eslint . configs . recommended ,
8
26
...tseslint . configs . recommended ,
9
27
...tseslint . configs . stylistic ,
10
28
{
29
+ languageOptions : {
30
+ globals : {
31
+ ...globals . node ,
32
+ } ,
33
+ } ,
11
34
rules : {
35
+ ...bestPracticesRules ,
36
+ ...errorsRules ,
37
+ ...es6Rules ,
38
+ ...nodeRules ,
39
+ ...strictRules ,
40
+ ...styleRules ,
41
+ ...variablesRules ,
42
+
43
+ 'class-methods-use-this' : 'off' ,
44
+ 'linebreak-style' : [ 'error' , ( process . platform === 'win32' ? 'windows' : 'unix' ) ] ,
45
+ 'max-len' : [ 'error' , { code : 120 , ignoreUrls : true } ] ,
46
+ 'no-underscore-dangle' : 'off' ,
47
+ 'no-unused-vars' : 'off' ,
48
+ 'object-curly-spacing' : [ 'error' , 'always' ] ,
49
+ 'operator-linebreak' : [ 'error' , 'after' ] ,
12
50
'quotes' : [ 'error' , 'single' ] ,
51
+ 'quote-props' : [ 'error' , 'consistent' ] ,
13
52
14
53
'@typescript-eslint/no-empty-function' : 'off' ,
15
54
'@typescript-eslint/no-explicit-any' : 'off' ,
@@ -21,14 +60,42 @@ export default tseslint.config(
21
60
destructuredArrayIgnorePattern : '^_' ,
22
61
} ,
23
62
] ,
24
- 'object-curly-spacing' : [ 'error' , 'always' ] ,
25
- }
63
+ } ,
64
+ } ,
65
+ {
66
+ files : [ 'src/formatter/templates/*.ts' ] ,
67
+ rules : {
68
+ 'indent' : 'off' ,
69
+ 'template-curly-spacing' : [ 'error' , 'always' ] ,
70
+ } ,
71
+ } ,
72
+ {
73
+ files : [ 'script/**/*.ts' ] ,
74
+ rules : {
75
+ 'no-console' : 'off' ,
76
+ } ,
77
+ } ,
78
+ {
79
+ files : [ 'test/**/*.test.ts' ] ,
80
+ ...eslintPluginJest . configs [ 'flat/recommended' ] ,
81
+ rules : {
82
+ ...eslintPluginJest . configs [ 'flat/recommended' ] . rules ,
83
+ 'jest/no-disabled-tests' : 'off' ,
84
+ 'jest/no-standalone-expect' : 'off' ,
85
+ 'jest/prefer-expect-assertions' : 'off' ,
86
+ } ,
87
+ } ,
88
+ {
89
+ files : [ 'test/utilities.ts' ] ,
90
+ rules : {
91
+ 'jest/no-export' : 'off' ,
92
+ } ,
26
93
} ,
27
94
{
28
95
ignores : [
29
96
'lib/**/*' ,
30
97
'src/normalize_mappings/suffix-normalize-mapping.ts' ,
31
98
'src/parser/*/peg_parser.ts' ,
32
- ]
33
- }
99
+ ] ,
100
+ } ,
34
101
) ;
0 commit comments