Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot selectively disable type checking when using defineConfigWithVueTs #136

Open
bmulholland opened this issue Jan 22, 2025 · 1 comment

Comments

@bmulholland
Copy link
Contributor

I'm trying to enable recommendedTypeChecked, coming from recommended, and eslint is crashing on a typecheck rule that's running on a yml file. So, I'd simply like to disable type checked rules for yml files. I'm following https://typescript-eslint.io/getting-started/typed-linting/#how-can-i-disable-type-aware-linting-for-a-subset-of-files

So I add:

  {
    files: ["**/*.yml"],
    extends: [vueTsConfigs.disableTypeChecked],
  },

Which has two issues:

  1. TS says extends doesn't exist in the type input for defineConfigWithVueTs
  2. An incorrect error is thrown when running eslint: Please wrap the config object with defineConfigWithVueTs(). I am indeed wrapping the config with that.
@haoqunjiang
Copy link
Member

Oops, I never thought about such scenario.

As a workaround you can add yet another defineConfigWithVueTs:


  {
    files: ["**/*.yml"],
    extends: [defineConfigWithVueTs(vueTsConfigs.disableTypeChecked)],
  },

The error was because all the vueTsConfigs.*presets are meant to be replaced, but it didn’t catch the pattern in your config.
Wrapping it in another defineConfigWithVueTs makes it a plain ESLint config object that can be extended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants