11const eslint = require ( '@eslint/js' ) ;
22const tseslint = require ( 'typescript-eslint' ) ;
3- const prettier = require ( 'eslint-plugin -prettier' ) ;
4- const importPlugin = require ( 'eslint-plugin-import ' ) ;
3+ const prettier = require ( 'eslint-config -prettier' ) ;
4+ const eslintPluginPrettier = require ( 'eslint-plugin-prettier/recommended ' ) ;
55
6- module . exports = tseslint . config (
7- eslint . configs . recommended ,
8- ...tseslint . configs . recommended ,
6+ module . exports = [
97 {
10- files : [ '**/*.ts' ] ,
11- languageOptions : {
12- ecmaVersion : 2018 ,
13- sourceType : 'module' ,
14- parser : tseslint . parser ,
15- parserOptions : {
16- project : './tsconfig.json' ,
8+ ignores : [
9+ '**/dist/**' ,
10+ '**/node_modules/**' ,
11+ '**/coverage/**' ,
12+ '**/*.test.ts' ,
13+ '**/*.test.js' ,
14+ '**/test/**' ,
15+ 'eslint.config.js' ,
16+ ] ,
17+ } ,
18+ ...tseslint . config (
19+ eslint . configs . recommended ,
20+ ...tseslint . configs . recommended ,
21+ prettier ,
22+ eslintPluginPrettier ,
23+ {
24+ languageOptions : {
25+ parserOptions : {
26+ ecmaVersion : 'latest' ,
27+ sourceType : 'commonjs' ,
28+ } ,
29+ globals : {
30+ // ES2015 globals
31+ Promise : 'readonly' ,
32+ Symbol : 'readonly' ,
33+ // Node.js globals
34+ process : 'readonly' ,
35+ module : 'readonly' ,
36+ require : 'readonly' ,
37+ __dirname : 'readonly' ,
38+ __filename : 'readonly' ,
39+ exports : 'readonly' ,
40+ // Jest globals
41+ jest : 'readonly' ,
42+ describe : 'readonly' ,
43+ it : 'readonly' ,
44+ expect : 'readonly' ,
45+ beforeEach : 'readonly' ,
46+ afterEach : 'readonly' ,
47+ // Other globals
48+ Atomics : 'readonly' ,
49+ SharedArrayBuffer : 'readonly' ,
50+ } ,
1751 } ,
18- } ,
19- plugins : {
20- '@typescript-eslint' : tseslint . plugin ,
21- 'prettier' : prettier ,
22- 'import' : importPlugin ,
23- } ,
24- rules : {
25- 'prettier/prettier' : 'error' ,
26- 'no-console' : 'off' ,
27- 'import/no-unresolved' : 'off' ,
28- 'import/extensions' : 'off' ,
29- 'comma-dangle' : 'off' ,
30- 'no-unused-vars' : 'off' ,
31- 'camelcase' : 'off' ,
32- } ,
33- settings : {
34- 'import/resolver' : {
35- typescript : { } ,
52+ rules : {
53+ 'prettier/prettier' : 'error' ,
54+ 'no-console' : 'off' ,
55+ 'import/no-unresolved' : 'off' ,
56+ 'import/extensions' : 'off' ,
57+ 'comma-dangle' : 'off' ,
58+ 'no-unused-vars' : 'off' ,
59+ camelcase : 'off' ,
60+ '@typescript-eslint/no-explicit-any' : 'off' ,
3661 } ,
37- } ,
38- } ,
39- {
40- files : [ '**/*.js' ] ,
41- languageOptions : {
42- ecmaVersion : 2018 ,
43- sourceType : 'module' ,
44- } ,
45- plugins : {
46- 'prettier' : prettier ,
47- 'import' : importPlugin ,
48- } ,
49- rules : {
50- 'prettier/prettier' : 'error' ,
51- 'no-console' : 'off' ,
52- 'import/no-unresolved' : 'off' ,
53- 'import/extensions' : 'off' ,
54- 'comma-dangle' : 'off' ,
55- } ,
56- } ,
57- {
58- ignores : [ 'dist/**' , 'node_modules/**' , 'coverage/**' ] ,
59- }
60- ) ;
62+ }
63+ ) ,
64+ ] ;
0 commit comments