Skip to content

Commit 41981c1

Browse files
committed
Changes to only disable boundary types on web apps
1 parent b881fcd commit 41981c1

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

eslint.config.mjs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,62 @@ export default ts.config(
417417
projectService: true,
418418
},
419419
},
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+
},
420476
rules: {
421477
'@typescript-eslint/explicit-module-boundary-types': 'off',
422478
'@typescript-eslint/no-restricted-imports': [

0 commit comments

Comments
 (0)