@@ -252,23 +252,27 @@ export default ts.config(
252252 'util' ,
253253 'vm' ,
254254 'zlib' ,
255- ] ,
256- patterns : [
257- {
258- group : [ '**/env/**/*' ] ,
259- message : 'Use @env/ instead' ,
260- } ,
261255 {
262- group : [ 'react-dom' ] ,
256+ name : 'react-dom' ,
263257 importNames : [ 'Container' ] ,
264258 message : 'Use our Container instead' ,
265259 } ,
266260 {
267- group : [ 'vscode' ] ,
261+ name : 'vscode' ,
268262 importNames : [ 'CancellationError' ] ,
269263 message : 'Use our CancellationError instead' ,
270264 } ,
271265 ] ,
266+ patterns : [
267+ {
268+ group : [ '**/env/**/*' ] ,
269+ message : 'Use @env/ instead' ,
270+ } ,
271+ {
272+ group : [ '**/webview/**/*' ] ,
273+ message : "Can't use any `webview`-only modules in extension" ,
274+ } ,
275+ ] ,
272276 } ,
273277 ] ,
274278 '@typescript-eslint/no-unnecessary-condition' : 'off' ,
@@ -339,14 +343,14 @@ export default ts.config(
339343 '@typescript-eslint/no-restricted-imports' : [
340344 'error' ,
341345 {
342- patterns : [
346+ paths : [
343347 {
344- group : [ 'react-dom' ] ,
348+ name : 'react-dom' ,
345349 importNames : [ 'Container' ] ,
346350 message : 'Use our Container instead' ,
347351 } ,
348352 {
349- group : [ 'vscode' ] ,
353+ name : 'vscode' ,
350354 importNames : [ 'CancellationError' ] ,
351355 message : 'Use our CancellationError instead' ,
352356 } ,
@@ -412,15 +416,23 @@ export default ts.config(
412416 '@typescript-eslint/no-restricted-imports' : [
413417 'error' ,
414418 {
419+ paths : [
420+ {
421+ name : 'vscode' ,
422+ message : "Can't use `vscode` in webviews" ,
423+ allowTypeImports : true ,
424+ } ,
425+ ] ,
415426 patterns : [
416427 {
417- group : [ 'Container' ] ,
428+ group : [ 'container' ] ,
429+ importNames : [ 'Container' ] ,
418430 message : "Can't use `Container` in webviews" ,
419431 allowTypeImports : true ,
420432 } ,
421433 {
422- group : [ 'vscode ' ] ,
423- message : "Can't use `vscode` in webviews" ,
434+ group : [ '**/-webview/**/* ' ] ,
435+ message : "Can't use any `-webview` modules in webviews" ,
424436 allowTypeImports : true ,
425437 } ,
426438 ] ,
0 commit comments