Skip to content

Commit 0d3bc9b

Browse files
committed
lint: Split up parsing options for typescript vs vue files
1 parent 74f2d39 commit 0d3bc9b

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

eslint.config.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import pluginVue from 'eslint-plugin-vue'
88
import { defineConfig } from 'eslint/config'
99
import globals from 'globals'
1010
import tseslint from 'typescript-eslint'
11+
import vueParser from 'vue-eslint-parser'
12+
13+
const extraFileExtensions = ['.vue']
1114

1215
export default defineConfig([
1316
{
@@ -22,18 +25,37 @@ export default defineConfig([
2225
]
2326
},
2427
{
25-
files: ['src/**/*.{js,mjs,cjs,ts,mts,vue}', './*.{ts,mts}'],
28+
files: ['./**/*.{ts,mts}'],
29+
languageOptions: {
30+
globals: {
31+
...globals.browser,
32+
__COMFYUI_FRONTEND_VERSION__: 'readonly'
33+
},
34+
parserOptions: {
35+
parser: tseslint.parser,
36+
projectService: true,
37+
tsConfigRootDir: import.meta.dirname,
38+
ecmaVersion: 2020,
39+
sourceType: 'module',
40+
extraFileExtensions
41+
}
42+
}
43+
},
44+
{
45+
files: ['./**/*.vue'],
2646
languageOptions: {
2747
globals: {
2848
...globals.browser,
2949
__COMFYUI_FRONTEND_VERSION__: 'readonly'
3050
},
51+
parser: vueParser,
3152
parserOptions: {
3253
parser: tseslint.parser,
3354
projectService: true,
55+
tsConfigRootDir: import.meta.dirname,
3456
ecmaVersion: 2020,
3557
sourceType: 'module',
36-
extraFileExtensions: ['.vue']
58+
extraFileExtensions
3759
}
3860
}
3961
},

0 commit comments

Comments
 (0)