@@ -18,9 +18,10 @@ export default defineConfig([
1818 'dist/**/*' ,
1919 'out/**/*' ,
2020 'src/@types/**/*.d.ts' ,
21- 'src/api/api.d.ts' ,
21+ 'src/api/api* .d.ts' ,
2222 'src/test/**' ,
2323 '**/*.{js,mjs,cjs}' ,
24+ '.vscode-test/**/*'
2425 ]
2526 } ,
2627
@@ -40,6 +41,24 @@ export default defineConfig([
4041 'rulesdir' : /** @type {any } */ ( rulesdir ) ,
4142 '@typescript-eslint' : tseslint . plugin ,
4243 } ,
44+ settings : {
45+ // Let plugin-import resolve TS paths (including d.ts, type packages, etc.)
46+ 'import/resolver' : {
47+ typescript : {
48+ project : [
49+ 'tsconfig.base.json' ,
50+ 'tsconfig.json' ,
51+ 'tsconfig.webviews.json'
52+ ] ,
53+ alwaysTryTypes : true
54+ } ,
55+ node : {
56+ extensions : [ '.js' , '.mjs' , '.cjs' , '.ts' , '.tsx' , '.d.ts' ]
57+ }
58+ } ,
59+ // For rules like import/extensions (list everything you consider "module" extensions)
60+ 'import/extensions' : [ '.js' , '.mjs' , '.cjs' , '.ts' , '.tsx' ]
61+ } ,
4362 rules : {
4463 // ESLint recommended rules
4564 ...js . configs . recommended . rules ,
@@ -50,17 +69,17 @@ export default defineConfig([
5069 'no-console' : 'off' ,
5170 'no-constant-condition' : [ 'warn' , { 'checkLoops' : false } ] ,
5271 'no-caller' : 'error' ,
53- 'no-case-declarations' : 'off' ,
72+ 'no-case-declarations' : 'off' , // TODO @alexr 00 revisit
5473 'no-debugger' : 'warn' ,
5574 'no-dupe-class-members' : 'off' ,
5675 'no-duplicate-imports' : 'error' ,
57- 'no-else-return' : 'off' ,
58- 'no-empty' : 'off' ,
76+ 'no-else-return' : 'off' , // TODO @alexr 00 revisit
77+ 'no-empty' : 'off' , // TODO @alexr 00 revisit
5978 'no-eval' : 'error' ,
6079 'no-ex-assign' : 'warn' ,
6180 'no-extend-native' : 'error' ,
6281 'no-extra-bind' : 'error' ,
63- 'no-extra-boolean-cast' : 'off' ,
82+ 'no-extra-boolean-cast' : 'off' , // TODO @alexr 00 revisit
6483 'no-floating-decimal' : 'error' ,
6584 'no-implicit-coercion' : 'off' ,
6685 'no-implied-eval' : 'error' ,
@@ -71,7 +90,7 @@ export default defineConfig([
7190 'no-multi-spaces' : 'off' ,
7291 'no-prototype-builtins' : 'off' ,
7392 'no-return-assign' : 'error' ,
74- 'no-return-await' : 'off' ,
93+ 'no-return-await' : 'off' , // TODO @alexr 00 revisit
7594 'no-self-compare' : 'error' ,
7695 'no-sequences' : 'error' ,
7796 'no-template-curly-in-string' : 'warn' ,
@@ -97,14 +116,14 @@ export default defineConfig([
97116 ] ,
98117 'no-unused-vars' : "off" , // Disable the base rule so we can use the TS version
99118 'object-shorthand' : 'off' ,
100- 'one-var' : 'off' ,
101- 'prefer-arrow-callback' : 'off' ,
119+ 'one-var' : 'off' , // TODO @alexr 00 revisit
120+ 'prefer-arrow-callback' : 'off' , // TODO @alexr 00 revisit
102121 'prefer-const' : 'off' ,
103122 'prefer-numeric-literals' : 'error' ,
104123 'prefer-object-spread' : 'error' ,
105124 'prefer-rest-params' : 'error' ,
106125 'prefer-spread' : 'error' ,
107- 'prefer-template' : 'off' ,
126+ 'prefer-template' : 'off' , // TODO @alexr 00 revisit
108127 'quotes' : [ 'error' , 'single' , { 'avoidEscape' : true , 'allowTemplateLiterals' : true } ] ,
109128 'require-atomic-updates' : 'off' ,
110129 'semi' : [ 'error' , 'always' ] ,
@@ -122,19 +141,38 @@ export default defineConfig([
122141
123142 // Import plugin rules
124143 'import/export' : 'off' ,
125- 'import/extensions' : [ 'error' , 'never' ] ,
144+ 'import/extensions' : [ 'error' , 'ignorePackages' , {
145+ js : 'never' ,
146+ mjs : 'never' ,
147+ cjs : 'never' ,
148+ ts : 'never' ,
149+ tsx : 'never'
150+ } ] ,
126151 'import/named' : 'off' ,
127152 'import/namespace' : 'off' ,
128153 'import/newline-after-import' : 'warn' ,
129154 'import/no-cycle' : 'off' ,
130155 'import/no-dynamic-require' : 'error' ,
131- 'import/no-default-export' : 'off' ,
156+ 'import/no-default-export' : 'off' , // TODO @alexr 00 revisit
132157 'import/no-duplicates' : 'error' ,
133158 'import/no-self-import' : 'error' ,
159+ 'import/no-unresolved' : [ 'warn' , { 'ignore' : [ 'vscode' , 'ghpr' , 'git' , 'extensionApi' , '@octokit/rest' , '@octokit/types' ] } ] ,
160+ 'import/order' : [
161+ 'warn' ,
162+ {
163+ 'groups' : [ 'builtin' , 'external' , 'internal' , [ 'parent' , 'sibling' , 'index' ] ] ,
164+ 'newlines-between' : 'ignore' ,
165+ 'alphabetize' : {
166+ 'order' : 'asc' ,
167+ 'caseInsensitive' : true
168+ }
169+ }
170+ ] ,
134171
135172 // TypeScript ESLint rules
136173 '@typescript-eslint/await-thenable' : 'error' ,
137- '@typescript-eslint/ban-types' : 'off' ,
174+ '@typescript-eslint/ban-types' : 'off' , // TODO@alexr 00 revisit
175+
138176 '@typescript-eslint/consistent-type-assertions' : [
139177 'warn' ,
140178 {
@@ -144,35 +182,37 @@ export default defineConfig([
144182 ] ,
145183 '@typescript-eslint/explicit-function-return-type' : 'off' ,
146184 '@typescript-eslint/explicit-member-accessibility' : 'off' ,
147- '@typescript-eslint/explicit-module-boundary-types' : 'off' ,
185+ '@typescript-eslint/explicit-module-boundary-types' : 'off' , // TODO@alexr 00 revisit
186+
148187 '@typescript-eslint/no-empty-function' : 'off' ,
149188 '@typescript-eslint/no-empty-interface' : 'error' ,
150189 '@typescript-eslint/no-explicit-any' : 'off' ,
151- '@typescript-eslint/no-floating-promises' : 'off' ,
190+ '@typescript-eslint/no-floating-promises' : 'off' , // TODO @alexr 00 revisit
152191 '@typescript-eslint/no-implied-eval' : 'error' ,
153- '@typescript-eslint/no-inferrable-types' : 'off' ,
192+ '@typescript-eslint/no-inferrable-types' : 'off' , // TODO @alexr 00 revisit
154193 '@typescript-eslint/no-misused-promises' : [ 'error' , { 'checksConditionals' : false , 'checksVoidReturn' : false } ] ,
155194 '@typescript-eslint/no-namespace' : 'off' ,
156195 '@typescript-eslint/no-non-null-assertion' : 'off' ,
196+ "@typescript-eslint/no-redeclare" : [ "error" , { "ignoreDeclarationMerge" : true } ] ,
157197 '@typescript-eslint/no-redundant-type-constituents' : 'off' ,
158198 '@typescript-eslint/no-this-alias' : 'off' ,
159199 '@typescript-eslint/no-unnecessary-condition' : 'off' ,
160- '@typescript-eslint/no-unnecessary-type-assertion' : 'off' ,
200+ '@typescript-eslint/no-unnecessary-type-assertion' : 'off' , // TODO @alexr 00 revisit
161201 '@typescript-eslint/no-unsafe-argument' : 'off' ,
162- '@typescript-eslint/no-unsafe-assignment' : 'off' ,
163- '@typescript-eslint/no-unsafe-call' : 'off' ,
202+ '@typescript-eslint/no-unsafe-assignment' : 'off' , // TODO @alexr 00 revisit
203+ '@typescript-eslint/no-unsafe-call' : 'off' , // TODO @alexr 00 revisit
164204 '@typescript-eslint/no-unsafe-enum-comparison' : 'off' ,
165- '@typescript-eslint/no-unsafe-member-access' : 'off' ,
166- '@typescript-eslint/no-unsafe-return' : 'off' ,
205+ '@typescript-eslint/no-unsafe-member-access' : 'off' , // TODO @alexr 00 revisit
206+ '@typescript-eslint/no-unsafe-return' : 'off' , // TODO @alexr 00 revisit
167207 '@typescript-eslint/no-unused-expressions' : [ 'warn' , { 'allowShortCircuit' : true } ] ,
168208 '@typescript-eslint/no-unused-vars' : [ 'error' , { 'argsIgnorePattern' : '^_' , caughtErrors : 'none' } ] ,
169209 '@typescript-eslint/no-use-before-define' : 'off' ,
170- '@typescript-eslint/prefer-regexp-exec' : 'off' ,
210+ '@typescript-eslint/prefer-regexp-exec' : 'off' , // TODO @alexr 00 revisit
171211 '@typescript-eslint/prefer-nullish-coalescing' : 'off' ,
172212 '@typescript-eslint/prefer-optional-chain' : 'off' ,
173- '@typescript-eslint/require-await' : 'off' ,
213+ '@typescript-eslint/require-await' : 'off' , // TODO @alexr 00 revisit
174214 '@typescript-eslint/restrict-plus-operands' : 'error' ,
175- '@typescript-eslint/restrict-template-expressions' : 'off' ,
215+ '@typescript-eslint/restrict-template-expressions' : 'off' , // TODO @alexr 00 revisit
176216 '@typescript-eslint/strict-boolean-expressions' : 'off' ,
177217 '@typescript-eslint/unbound-method' : 'off' ,
178218
@@ -216,10 +256,7 @@ export default defineConfig([
216256 ...globals . browser ,
217257 'Thenable' : true ,
218258 } ,
219- } ,
220- rules : {
221- 'rulesdir/public-methods-well-defined-types' : 'error'
222- } ,
259+ }
223260 } ,
224261
225262 // Webviews
@@ -236,6 +273,9 @@ export default defineConfig([
236273 ...globals . browser ,
237274 'JSX' : true ,
238275 } ,
239- }
276+ } ,
277+ rules : {
278+ 'rulesdir/public-methods-well-defined-types' : 'error'
279+ } ,
240280 } ,
241281] ) ;
0 commit comments