-
Notifications
You must be signed in to change notification settings - Fork 33
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
False positive no-unused-vars when importing typescript type in .vue file #14
Comments
Same here and not just for imported types... |
I am also receiving the same error. Here is a reproducible example.
Throws error: |
I have a similar problem with eslint core rule The reason is that some eslint core rules should be disabled.
In my case edit: overrides: [
{
files: ['*.vue'],
rules: require('@typescript-eslint/eslint-plugin').configs['eslint-recommended'].overrides[0].rules,
},
], |
I'm seeing similar issues in our codebase. Can verify there's issues with Also was seeing issues with globals. I was able to resolve those by adding them to the globals in the config
|
i have also problem with the rule no-undef when using the ruleset @vue/typescript/recommended error: 'NotificationPermission' is not defined (no-undef) at src\views\Navigation.vue:72:28 |
Airbnb & Standard options are not added yet. The difference with the previous implementation is that we now use `@vue/eslint-config-typescript` instead of `@vue/eslint-config-typescript/recommended`, because I'm not very satisfied with the current implementation of the latter config. There are some edge cases that may confuse users. I need to find time to refactor that package in the coming months.
Fixes vuejs/eslint-config-typescript#14 Fixes vuejs/create-vue#158 Technically turning new rules on would be a breaking change because it introduces more errors in an existing codebase. However, in our README we've already made it clear that this ruleset should only be used with `@vue/cli` or `create-vue`, so an existing `eslint:recommended` config is expected, thus no breaking changes. Nevertheless, I choose to make it `warn` instead of `error` to minimize the impact.
Fixes vuejs/eslint-config-typescript#14 Fixes vuejs/create-vue#158 Technically turning new rules on would be a breaking change because it introduces more errors in an existing codebase. However, in our README we've already made it clear that this ruleset should only be used with `@vue/cli` or `create-vue`, so an existing `eslint:recommended` config is expected, thus no breaking changes. Nevertheless, I choose to make it `warn` instead of `error` to minimize the impact.
I am getting a false positive error
no-unused-vars
when importing and using a typescript type in a .vue file.My
eslintrc.js
:One possible workaround I found is to disable the
no-used-vars
rule for .vue files and enable@typescript-eslint/no-unused-vars
:The text was updated successfully, but these errors were encountered: