File tree 5 files changed +77
-31
lines changed
5 files changed +77
-31
lines changed Original file line number Diff line number Diff line change 1
- module . exports = {
2
- extends : [ 'eslint:recommended' , 'plugin:n/recommended' ] ,
3
- plugins : [ 'n' ] ,
1
+ const nodePlugin = require ( 'eslint-plugin-n' ) ;
2
+ const eslintJs = require ( '@eslint/js' ) ;
3
+ const globals = require ( 'globals' ) ;
4
+
5
+ const commonConfig = {
6
+ languageOptions : {
7
+ globals : {
8
+ ...globals . node ,
9
+ ...globals . es6 ,
10
+ } ,
11
+ } ,
4
12
rules : {
5
13
// override recommended
6
14
'no-empty' : [ 'error' , { allowEmptyCatch : true } ] ,
@@ -133,8 +141,10 @@ module.exports = {
133
141
'template-curly-spacing' : 'error' ,
134
142
'yield-star-spacing' : 'error' ,
135
143
} ,
136
- env : {
137
- node : true ,
138
- es6 : true
139
- }
140
144
} ;
145
+
146
+ module . exports = [
147
+ eslintJs . configs . recommended ,
148
+ nodePlugin . configs [ "flat/recommended-script" ] ,
149
+ commonConfig ,
150
+ ] ;
Original file line number Diff line number Diff line change 15
15
" ts.js" ,
16
16
" ts-test.js"
17
17
],
18
+ "exports" : {
19
+ "./eslint" : " ./eslint.js" ,
20
+ "./test" : " ./test.js" ,
21
+ "./ts" : " ./ts.js" ,
22
+ "./ts-test" : " ./ts-test.js"
23
+ },
18
24
"author" :
" Tommy Chen <[email protected] > (http://zespia.tw)" ,
19
25
"maintainers" : [
20
26
" Abner Chou <[email protected] > (http://abnerchou.me)"
21
27
],
22
28
"license" : " MIT" ,
23
29
"peerDependencies" : {
24
- "eslint" : " >= 8.23 .0"
30
+ "eslint" : " >= 9.17 .0"
25
31
},
26
32
"dependencies" : {
27
- "eslint-plugin-n" : " ^17.9.0" ,
28
- "@typescript-eslint/eslint-plugin" : " ^7.15.0" ,
29
- "@typescript-eslint/parser" : " ^7.15.0"
33
+ "@eslint/js" : " ^9.17.0" ,
34
+ "eslint-plugin-n" : " ^17.15.1" ,
35
+ "globals" : " ^15.14.0" ,
36
+ "typescript-eslint" : " ^8.19.0" ,
37
+ "eslint-plugin-mocha" : " ^10.5.0"
30
38
},
31
39
"engines" : {
32
40
"node" : " >=18"
Original file line number Diff line number Diff line change 1
- module . exports = {
2
- extends : './eslint.js' ,
1
+ const jsConfig = require ( './eslint.js' ) ;
2
+ const globals = require ( 'globals' ) ;
3
+ const mochaPlugin = require ( 'eslint-plugin-mocha' ) ;
4
+
5
+ const testConfig = {
6
+ ...mochaPlugin . configs . flat . recommended ,
7
+ languageOptions : {
8
+ globals : {
9
+ ...globals . mocha
10
+ } ,
11
+ } ,
3
12
rules : {
4
- 'no-unused-expressions' : 'off'
13
+ 'no-unused-expressions' : 0 ,
14
+ "mocha/no-mocha-arrows" : 0 ,
15
+ "mocha/handle-done-callback" : 0 ,
16
+ "mocha/max-top-level-suites" : 0 ,
5
17
} ,
6
- env : {
7
- mocha : true
8
- }
9
18
} ;
19
+
20
+ module . exports = [
21
+ ...jsConfig ,
22
+ testConfig
23
+ ] ;
Original file line number Diff line number Diff line change 1
- module . exports = {
2
- extends : './ts.js' ,
1
+ const tsConfig = require ( './ts.js' ) ;
2
+ const globals = require ( 'globals' ) ;
3
+
4
+ const tsTestConfig = {
5
+ languageOptions : {
6
+ globals : {
7
+ ...globals . mocha
8
+ } ,
9
+ } ,
3
10
rules : {
4
11
'no-unused-expressions' : 'off'
5
12
} ,
6
- env : {
7
- mocha : true
8
- }
9
13
} ;
14
+
15
+ module . exports = [
16
+ ...tsConfig ,
17
+ tsTestConfig ,
18
+ ] ;
Original file line number Diff line number Diff line change 1
- module . exports = {
2
- parser : '@typescript-eslint/parser' ,
3
- plugins : [ '@typescript-eslint' ] ,
4
- extends : [
5
- './eslint.js' ,
6
- 'plugin:@typescript-eslint/recommended'
7
- ] ,
1
+ const tsEslint = require ( 'typescript-eslint' ) ;
2
+ const nodePlugin = require ( 'eslint-plugin-n' ) ;
3
+ const jsConfig = require ( './eslint.js' ) ;
4
+
5
+ const nodeConfig = {
8
6
rules : {
9
7
'n/no-unsupported-features/es-syntax' : [ 'error' , { 'ignores' : [ 'modules' ] } ] ,
10
8
'n/no-missing-import' : [ 'error' , { 'tryExtensions' : [ '.js' , '.ts' ] } ]
11
- }
12
- } ;
9
+ } ,
10
+ }
11
+
12
+ module . exports = [ ] . concat (
13
+ jsConfig ,
14
+ nodePlugin . configs [ "flat/mixed-esm-and-cjs" ] ,
15
+ ...tsEslint . configs . recommended ,
16
+ nodeConfig ,
17
+ ) ;
You can’t perform that action at this time.
0 commit comments