1- import globals from 'globals'
1+ import tsParser from '@typescript-eslint/parser'
2+ import importPlugin from 'eslint-plugin-import'
23
34export default [
4- {
5- ignores : [
6- 'node_modules/**' ,
7- 'coverage/**'
8- ] ,
5+ {
6+ ignores : [
7+ 'dist/**' ,
8+ 'node_modules/**' ,
9+ 'coverage/**'
10+ ] ,
11+ } ,
12+ {
13+ files : [ 'src/**/*.ts' ] ,
14+ languageOptions : {
15+ parser : tsParser ,
16+ parserOptions : {
17+ project : [ './tsconfig.json' ] ,
18+ sourceType : 'module' ,
19+ } ,
920 } ,
10- {
11- files : [ 'src/**/*.js' ] ,
12- languageOptions : {
13- globals : {
14- ...globals . browser ,
15- ...globals . node ,
16- Atomics : 'readonly' ,
17- SharedArrayBuffer : 'readonly' ,
18- } ,
19- } ,
20-
21- rules : {
22- // Code style - match TypeScript settings
23- semi : [ 'error' , 'never' ] ,
24- quotes : [ 'error' , 'single' ] ,
25-
26- // Strict checking - match TypeScript strictness
27- 'no-console' : 'warn' ,
28- 'no-unused-vars' : 'warn' , // Match TypeScript noUnusedLocals: true
29- 'no-undef' : 'error' ,
30- strict : [ 'error' , 'global' ] , // Match TypeScript alwaysStrict: true
31-
32- // Additional strictness to match TypeScript behavior
33- 'no-implicit-globals' : 'error' ,
34- 'prefer-const' : 'error' , // Encourage immutability
35- 'no-var' : 'error' , // Use let/const only
36- 'no-redeclare' : 'error'
37- }
21+ plugins : {
22+ import : importPlugin ,
23+ } ,
24+ rules : {
25+ // Style rules (not handled by TypeScript)
26+ semi : [ 'error' , 'never' ] ,
27+ quotes : [ 'error' , 'single' ] ,
28+
29+ // Disable ESLint rules that TypeScript handles better
30+ 'no-unused-vars' : 'off' , // TypeScript handles this via noUnusedLocals
31+ 'no-undef' : 'off' , // TypeScript handles undefined variables
32+ } ,
33+ } ,
34+ {
35+ files : [ 'test/**/*.ts' ] ,
36+ languageOptions : {
37+ parser : tsParser ,
38+ parserOptions : {
39+ project : [ './tsconfig.test.json' ] ,
40+ } ,
41+ } ,
42+ rules : {
43+ semi : [ 'error' , 'never' ] ,
44+ quotes : [ 'error' , 'single' ] ,
45+ 'no-console' : 'off' , // Allow console in tests
46+ 'no-undef' : 'off' , // Tests may define globals
3847 }
39- ]
48+ }
49+ ]
0 commit comments