1- import * as eslint from '@eslint/js' ;
21import tseslint from '@typescript-eslint/eslint-plugin' ;
32import tsParser from '@typescript-eslint/parser' ;
43import noOnlyTests from 'eslint-plugin-no-only-tests' ;
54import prettier from 'eslint-config-prettier' ;
5+ import importPlugin from 'eslint-plugin-import' ;
66import js from '@eslint/js' ;
77
88export default [
9- js . configs . recommended ,
109 {
10+ // Base JS recommended config
11+ ignores : [ '**/node_modules/**' ] ,
12+ linterOptions : {
13+ reportUnusedDisableDirectives : 'off' ,
14+ } ,
15+ rules : {
16+ ...js . configs . recommended . rules ,
17+ 'no-undef' : 'off' ,
18+ } ,
19+ } ,
20+ {
21+ files : [ '**/*.ts' , '**/*.tsx' ] ,
1122 languageOptions : {
1223 parser : tsParser ,
1324 parserOptions : {
1425 ecmaVersion : 'latest' ,
1526 sourceType : 'module' ,
1627 } ,
1728 globals : {
18- ...js . configs . recommended . languageOptions . globals ,
29+ ...( js . configs . recommended . languageOptions ? .globals || { } ) ,
1930 mocha : true ,
31+ require : 'readonly' ,
32+ process : 'readonly' ,
33+ exports : 'readonly' ,
34+ module : 'readonly' ,
35+ __dirname : 'readonly' ,
36+ __filename : 'readonly' ,
37+ setTimeout : 'readonly' ,
38+ setInterval : 'readonly' ,
39+ clearTimeout : 'readonly' ,
40+ clearInterval : 'readonly' ,
2041 } ,
2142 } ,
2243 plugins : {
2344 '@typescript-eslint' : tseslint ,
2445 'no-only-tests' : noOnlyTests ,
46+ import : importPlugin ,
2547 } ,
2648 settings : {
2749 'import/resolver' : {
@@ -31,50 +53,37 @@ export default [
3153 } ,
3254 } ,
3355 rules : {
34- ...eslint . configs . recommended . rules ,
56+ 'import/no-unresolved' : 'off' , // ✅ Suppresses errors for "import/no-unresolved"
57+ // ✅ Suppresses undefined variable errors (e.g., "suite" not defined)
58+ '@typescript-eslint/explicit-module-boundary-types' : 'off' , // ✅ Suppresses function return type errors
59+ ...tseslint . configs . recommended . rules ,
3560 ...prettier . rules ,
61+
3662 '@typescript-eslint/ban-ts-comment' : [
3763 'error' ,
3864 {
3965 'ts-ignore' : 'allow-with-description' ,
4066 } ,
4167 ] ,
42- '@typescript-eslint/explicit-module-boundary-types' : 'error' ,
4368 'no-bitwise' : 'off' ,
4469 'no-dupe-class-members' : 'off' ,
4570 '@typescript-eslint/no-dupe-class-members' : 'error' ,
46- 'no-empty-function' : 'off' ,
47- '@typescript-eslint/no-empty-function' : [ 'error' ] ,
4871 '@typescript-eslint/no-empty-interface' : 'off' ,
49- '@typescript-eslint/no-explicit-any' : 'error' ,
5072 '@typescript-eslint/no-non-null-assertion' : 'off' ,
51- '@typescript-eslint/no-unused-vars' : [
52- 'error' ,
53- {
54- args : 'after-used' ,
55- argsIgnorePattern : '^_' ,
56- } ,
57- ] ,
5873 '@typescript-eslint/no-use-before-define' : [
5974 'error' ,
6075 {
6176 functions : false ,
6277 } ,
6378 ] ,
79+
6480 'no-useless-constructor' : 'off' ,
6581 '@typescript-eslint/no-useless-constructor' : 'error' ,
6682 '@typescript-eslint/no-var-requires' : 'off' ,
67- 'class-methods-use-this' : [ 'error' , { exceptMethods : [ 'dispose' ] } ] ,
6883 'func-names' : 'off' ,
6984 'import/extensions' : 'off' ,
7085 'import/namespace' : 'off' ,
7186 'import/no-extraneous-dependencies' : 'off' ,
72- 'import/no-unresolved' : [
73- 'error' ,
74- {
75- ignore : [ 'monaco-editor' , 'vscode' ] ,
76- } ,
77- ] ,
7887 'import/prefer-default-export' : 'off' ,
7988 'linebreak-style' : 'off' ,
8089 'no-await-in-loop' : 'off' ,
@@ -106,15 +115,27 @@ export default [
106115 'no-template-curly-in-string' : 'off' ,
107116 'no-underscore-dangle' : 'off' ,
108117 'no-useless-escape' : 'off' ,
109- 'no-void' : [
110- 'error' ,
111- {
112- allowAsStatement : true ,
113- } ,
114- ] ,
118+ 'no-void' : 'off' ,
115119 'operator-assignment' : 'off' ,
116120 strict : 'off' ,
117121 'no-only-tests/no-only-tests' : [ 'error' , { block : [ 'test' , 'suite' ] , focus : [ 'only' ] } ] ,
122+ 'class-methods-use-this' : 'off' ,
123+ '@typescript-eslint/ban-types' : 'off' ,
124+ // '@typescript-eslint/no-empty-function': 'off',
125+ // 'import/no-unresolved': ['error', { ignore: ['vscode'] }],
126+ '@typescript-eslint/no-explicit-any' : 'off' ,
127+ // add no-unreachable
128+ 'no-unreachable' : 'off' ,
129+ //add @typescript -eslint/no-empty-function
130+ 'no-empty-function' : 'off' ,
131+ 'no-redeclare' : 'off' ,
132+ '@typescript-eslint/no-loss-of-precision' : 'off' , // add @typescript -eslint/no-loss-of-precision
133+ 'no-empty' : [ 'error' , { allowEmptyCatch : true } ] ,
134+ 'no-inner-declarations' : 'off' ,
135+ 'no-async-promise-executor' : 'off' ,
136+ '@typescript-eslint/no-namespace' : 'off' ,
137+ '@typescript-eslint/no-unused-vars' : [ 'warn' , { varsIgnorePattern : '^_' , argsIgnorePattern : '^_' } ] ,
138+ 'no-undef' : 'off' ,
118139 } ,
119140 } ,
120141] ;
0 commit comments