@@ -51,7 +51,10 @@ export default function createConfig({
5151 files : [ '**/*.js' , '**/*.jsx' ] ,
5252 ...tseslint . configs . disableTypeChecked ,
5353 } ,
54- {
54+ ]
55+
56+ if ( otherVueFiles . length > 0 ) {
57+ projectServiceConfigs . push ( {
5558 name : 'vue-typescript/skip-type-checking-for-vue-files-without-ts' ,
5659 files : otherVueFiles ,
5760 ...tseslint . configs . disableTypeChecked ,
@@ -63,9 +66,9 @@ export default function createConfig({
6366 // https://github.com/typescript-eslint/typescript-eslint/issues/4755#issuecomment-1080961338
6467 '@typescript-eslint/consistent-type-imports' : 'off' ,
6568 '@typescript-eslint/prefer-optional-chain' : 'off' ,
66- }
67- } ,
68- ]
69+ } ,
70+ } )
71+ }
6972
7073 const mayHaveJsxInSfc = supportedScriptLangs . jsx || supportedScriptLangs . tsx
7174 const needsTypeAwareLinting = configNamesToExtend . some (
@@ -87,18 +90,20 @@ export default function createConfig({
8790 } ,
8891 } )
8992
90- projectServiceConfigs . push ( {
91- name : 'vue-typescript/default-project-service-for-vue-files' ,
92- files : vueFilesWithScriptTs ,
93- languageOptions : {
94- parser : vueParser ,
95- parserOptions : {
96- projectService : true ,
97- parser : tseslint . parser ,
98- extraFileExtensions,
93+ if ( vueFilesWithScriptTs . length > 0 ) {
94+ projectServiceConfigs . push ( {
95+ name : 'vue-typescript/default-project-service-for-vue-files' ,
96+ files : vueFilesWithScriptTs ,
97+ languageOptions : {
98+ parser : vueParser ,
99+ parserOptions : {
100+ projectService : true ,
101+ parser : tseslint . parser ,
102+ extraFileExtensions,
103+ } ,
99104 } ,
100- } ,
101- } )
105+ } )
106+ }
102107
103108 // Vue's own typing inevitably contains some `any`s, so some of the `no-unsafe-*` rules can't be used.
104109 projectServiceConfigs . push ( {
0 commit comments