Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How to prevent @vue/typescript/default-project-service-for-ts-files from being spawned in my ESLint config? #193

Open
@Lumiobyte

Description

@Lumiobyte

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:

Image

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions