@@ -43,67 +43,7 @@ export default ts.config(
4343 'no-loop-func' : 'error' ,
4444 'no-mixed-spaces-and-tabs' : 'off' ,
4545 'no-restricted-globals' : [ 'error' , 'process' ] ,
46- 'no-restricted-imports' : [
47- 'error' ,
48- {
49- paths : [
50- 'assert' ,
51- 'buffer' ,
52- 'child_process' ,
53- 'cluster' ,
54- 'crypto' ,
55- 'dgram' ,
56- 'dns' ,
57- 'domain' ,
58- 'events' ,
59- 'freelist' ,
60- 'fs' ,
61- 'http' ,
62- 'https' ,
63- 'module' ,
64- 'net' ,
65- 'os' ,
66- 'path' ,
67- 'process' ,
68- 'punycode' ,
69- 'querystring' ,
70- 'readline' ,
71- 'repl' ,
72- 'smalloc' ,
73- 'stream' ,
74- 'string_decoder' ,
75- 'sys' ,
76- 'timers' ,
77- 'tls' ,
78- 'tracing' ,
79- 'tty' ,
80- 'url' ,
81- 'util' ,
82- 'vm' ,
83- 'zlib' ,
84- ] ,
85- patterns : [
86- {
87- group : [ '**/env/**/*' ] ,
88- message : 'Use @env/ instead' ,
89- } ,
90- {
91- group : [ 'src/*' ] ,
92- message : 'Use relative paths instead' ,
93- } ,
94- {
95- group : [ 'react-dom' ] ,
96- importNames : [ 'Container' ] ,
97- message : 'Use our Container instead' ,
98- } ,
99- {
100- group : [ 'vscode' ] ,
101- importNames : [ 'CancellationError' ] ,
102- message : 'Use our CancellationError instead' ,
103- } ,
104- ] ,
105- } ,
106- ] ,
46+ 'no-restricted-imports' : 'off' ,
10747 'no-return-assign' : 'error' ,
10848 'no-return-await' : 'warn' ,
10949 'no-self-compare' : 'error' ,
@@ -239,6 +179,67 @@ export default ts.config(
239179 '@typescript-eslint/no-misused-promises' : [ 'error' , { checksVoidReturn : false } ] ,
240180 '@typescript-eslint/no-non-null-assertion' : 'off' ,
241181 '@typescript-eslint/no-redundant-type-constituents' : 'off' ,
182+ '@typescript-eslint/no-restricted-imports' : [
183+ 'error' ,
184+ {
185+ paths : [
186+ 'assert' ,
187+ 'buffer' ,
188+ 'child_process' ,
189+ 'cluster' ,
190+ 'crypto' ,
191+ 'dgram' ,
192+ 'dns' ,
193+ 'domain' ,
194+ 'events' ,
195+ 'freelist' ,
196+ 'fs' ,
197+ 'http' ,
198+ 'https' ,
199+ 'module' ,
200+ 'net' ,
201+ 'os' ,
202+ 'path' ,
203+ 'process' ,
204+ 'punycode' ,
205+ 'querystring' ,
206+ 'readline' ,
207+ 'repl' ,
208+ 'smalloc' ,
209+ 'stream' ,
210+ 'string_decoder' ,
211+ 'sys' ,
212+ 'timers' ,
213+ 'tls' ,
214+ 'tracing' ,
215+ 'tty' ,
216+ 'url' ,
217+ 'util' ,
218+ 'vm' ,
219+ 'zlib' ,
220+ ] ,
221+ patterns : [
222+ {
223+ group : [ '**/env/**/*' ] ,
224+ message : 'Use @env/ instead' ,
225+ } ,
226+ {
227+ group : [ 'src/*' ] ,
228+ message : 'Use relative paths instead' ,
229+ } ,
230+ {
231+ group : [ 'react-dom' ] ,
232+ importNames : [ 'Container' ] ,
233+ message : 'Use our Container instead' ,
234+ } ,
235+ {
236+ group : [ 'vscode' ] ,
237+ importNames : [ 'CancellationError' ] ,
238+ message : 'Use our CancellationError instead' ,
239+ } ,
240+ ] ,
241+ } ,
242+ ] ,
242243 '@typescript-eslint/no-unnecessary-condition' : 'off' ,
243244 '@typescript-eslint/no-unnecessary-boolean-literal-compare' : 'off' ,
244245 '@typescript-eslint/no-unnecessary-type-parameters' : 'off' , // https://github.com/typescript-eslint/typescript-eslint/issues/9705
@@ -308,7 +309,7 @@ export default ts.config(
308309 {
309310 files : [ 'src/env/node/**/*' ] ,
310311 rules : {
311- 'no-restricted-imports' : [
312+ '@typescript-eslint/ no-restricted-imports' : [
312313 'error' ,
313314 {
314315 patterns : [
@@ -321,6 +322,11 @@ export default ts.config(
321322 importNames : [ 'Container' ] ,
322323 message : 'Use our Container instead' ,
323324 } ,
325+ {
326+ group : [ 'vscode' ] ,
327+ importNames : [ 'CancellationError' ] ,
328+ message : 'Use our CancellationError instead' ,
329+ } ,
324330 ] ,
325331 } ,
326332 ] ,
@@ -349,7 +355,24 @@ export default ts.config(
349355 name : 'webviews' ,
350356 ...litConfigs [ 'flat/recommended' ] ,
351357 ...wcConfigs [ 'flat/recommended' ] ,
352- files : [ 'src/webviews/apps/**/*' , 'src/env/browser/**/*' ] ,
358+ // Keep in sync with `src/webviews/apps/tsconfig.json`
359+ files : [
360+ 'src/webviews/apps/**/*' ,
361+ 'src/@types/**/*' ,
362+ 'src/env/browser/**/*' ,
363+ 'src/plus/gk/account/promos.ts' ,
364+ 'src/plus/gk/account/subscription.ts' ,
365+ 'src/plus/webviews/**/protocol.ts' ,
366+ 'src/webviews/protocol.ts' ,
367+ 'src/webviews/**/protocol.ts' ,
368+ 'src/config.ts' ,
369+ 'src/constants.ts' ,
370+ 'src/constants.*.ts' ,
371+ 'src/features.ts' ,
372+ 'src/subscription.ts' ,
373+ 'src/system/*.ts' ,
374+ 'src/system/decorators/log.ts' ,
375+ ] ,
353376 languageOptions : {
354377 globals : {
355378 ...globals . browser ,
@@ -364,6 +387,29 @@ export default ts.config(
364387 projectService : true ,
365388 } ,
366389 } ,
390+ rules : {
391+ '@typescript-eslint/no-restricted-imports' : [
392+ 'error' ,
393+ {
394+ patterns : [
395+ {
396+ group : [ 'src/*' ] ,
397+ message : 'Use relative paths instead' ,
398+ } ,
399+ {
400+ group : [ 'react-dom' ] ,
401+ importNames : [ 'Container' ] ,
402+ message : 'Use our Container instead' ,
403+ } ,
404+ {
405+ group : [ 'vscode' ] ,
406+ message : "Can't use vscode in webviews" ,
407+ allowTypeImports : true ,
408+ } ,
409+ ] ,
410+ } ,
411+ ] ,
412+ } ,
367413 settings : {
368414 wc : {
369415 elementBaseClasses : [
@@ -390,6 +436,9 @@ export default ts.config(
390436 projectService : true ,
391437 } ,
392438 } ,
439+ rules : {
440+ '@typescript-eslint/no-restricted-imports' : 'off' ,
441+ } ,
393442 } ,
394443 // {
395444 // name: 'tests:unit',
0 commit comments