File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -417,6 +417,62 @@ export default ts.config(
417
417
projectService : true ,
418
418
} ,
419
419
} ,
420
+ rules : {
421
+ '@typescript-eslint/no-restricted-imports' : [
422
+ 'error' ,
423
+ {
424
+ paths : [
425
+ {
426
+ name : 'vscode' ,
427
+ message : "Can't use `vscode` in webviews" ,
428
+ allowTypeImports : true ,
429
+ } ,
430
+ ] ,
431
+ patterns : [
432
+ {
433
+ group : [ 'container' ] ,
434
+ importNames : [ 'Container' ] ,
435
+ message : "Can't use `Container` in webviews" ,
436
+ allowTypeImports : true ,
437
+ } ,
438
+ {
439
+ group : [ '**/-webview/**/*' ] ,
440
+ message : "Can't use any `-webview` modules in webviews" ,
441
+ allowTypeImports : true ,
442
+ } ,
443
+ ] ,
444
+ } ,
445
+ ] ,
446
+ } ,
447
+ settings : {
448
+ wc : {
449
+ elementBaseClasses : [
450
+ 'LitElement' , // Recognize `LitElement` as a Custom Element base class
451
+ 'GlElement' ,
452
+ ] ,
453
+ } ,
454
+ } ,
455
+ } ,
456
+ {
457
+ name : 'webviews-apps-only' ,
458
+ ...litConfigs [ 'flat/recommended' ] ,
459
+ ...wcConfigs [ 'flat/recommended' ] ,
460
+ files : [ 'src/webviews/apps/**/*' ] ,
461
+ ignores : [ '**/-webview/**/*' ] ,
462
+ languageOptions : {
463
+ globals : {
464
+ ...globals . browser ,
465
+ } ,
466
+ parser : ts . parser ,
467
+ parserOptions : {
468
+ ecmaVersion : 2022 ,
469
+ sourceType : 'module' ,
470
+ ecmaFeatures : {
471
+ impliedStrict : true ,
472
+ } ,
473
+ projectService : true ,
474
+ } ,
475
+ } ,
420
476
rules : {
421
477
'@typescript-eslint/explicit-module-boundary-types' : 'off' ,
422
478
'@typescript-eslint/no-restricted-imports' : [
You can’t perform that action at this time.
0 commit comments