Closed Dylancyclone closed 5 months ago
Does that warning come from eslint itself or from somewhere else? Do you also get that warning when you run eslint in the console?
Looks like it's coming from the typescript compiler, not eslint.
I found a few issues describing the same thing https://github.com/vuejs/eslint-plugin-vue/issues/1810 and https://github.com/vuejs/language-tools/issues/604, both of which recommended using this package https://github.com/Shinigami92/eslint-plugin-vue-pug-sfc. But that has since been archived in favor of this package. Before migrating this project to typescript, this plugin was successfully handling all the rules (thanks again), so the only difference appears to be typescript
Sadly eslint-plugin-vue-pug can only provide pug support to eslint rules. Eslint can include a typescript pass and there is @vue/eslint-config-typescript which helps setting up typescript inside eslint.
eslint-plugin-vue-pug can't teach other typescript (editor) tools how to parse pug though. The direct ts integration in vscode for example isn't aware of pug, leading to the issue you describe.
There is https://www.npmjs.com/package/@vue/language-plugin-pug. I haven't tried that out myself though.
At a first glance, it looks like @vue/language-plugin-pug
is doing the trick! Thank you very much!
Sadly eslint-plugin-vue-pug can only provide pug support to eslint rules. Eslint can include a typescript pass and there is @vue/eslint-config-typescript which helps setting up typescript inside eslint.
eslint-plugin-vue-pug can't teach other typescript (editor) tools how to parse pug though. The direct ts integration in vscode for example isn't aware of pug, leading to the issue you describe.
There is https://www.npmjs.com/package/@vue/language-plugin-pug. I haven't tried that out myself though.
At a first glance, it looks like
@vue/language-plugin-pug
is doing the trick! Thank you very much!
@vue/language-plugin-pug is right. thinks. But I have another question eslint --fix will remove no-unused-imports,Will mistakenly remove used。 Can Help me? thinks。
This is my configuration
Please create a separate issue for this new problem, with a clean reproduction if possible.
I'm working on a project with the following structure:
And I'm having trouble getting this plugin to work with typescript. Whenever I have my SFC with both the template using
pug
and the script usingts
, typescript cannot find components/variables being used in the template and throws an error saying they're unused..eslint.cjs:
Thank you for your awesome work on this plugin!