How to prevent @vue/typescript/default-project-service-for-ts-files from being spawned in my ESLint config?
Opened this issue · 1 comments
I am using @vue/eslint-plugin-typescript in the recommended way, here is my config:
export default defineConfigWithVueTs([
// other config objects here
{
name: "Vue",
files: ["**/*.vue"],
extends: [eslintPluginVue.configs["flat/vue2-recommended"], vueTsConfigs.base],
languageOptions: {
parser: vueParser,
},
rules: {
"vue/html-indent": [2, 2],
"vue/max-attributes-per-line": 0,
"func-call-spacing": 0,
"vue/singleline-html-element-content-newline": 0,
"vue/block-lang": 0,
"@typescript-eslint/consistent-type-imports": [
2,
{
prefer: "type-imports",
fixStyle: "inline-type-imports",
disallowTypeAnnotations: false,
},
],
quotes: [1, "single", { avoidEscape: true }],
},
},
]);However, this is undesirably enabling type-aware linting for my project. This induces too much performance penalty, and I'd like for it to simply be turned off for all files. I determined that extending flat/vue2-recommended and vueTsConfigs.base is the direct culprit that causes typechecking to be enabled.
I can verify the origin of the project service that is being configued by using @eslint/config-inspector:
The last two config blocks applying to a given .ts file are the above.
I could simply add a block to the very end of my config that overrides the project service back to being disabled, but I'd rather understand why it's becoming enabled in the first place, and whether there is a way for this behaviour to be corrected?
thanks :)
eslint-config-typescript/src/internals.ts
Lines 23 to 32 in 643b038
Actually, it's caused by @typescript-eslint/consistent-type-imports for the reasons stated in the code comments above.
I'm not sure if we need to add this caveat to README…
If this slowdown is intolerable to you, please consider:
- Use
verbatimModuleSyntaxintsconfig.jsonto let TypeScript enforce this rule instead. - Use Oxlint or Biome alongside ESLint. They both support this rule and don't require type-aware linting.