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

Vue2 single-file components (SFC) support #1

Open
snandos opened this issue Feb 8, 2023 · 1 comment
Open

Vue2 single-file components (SFC) support #1

snandos opened this issue Feb 8, 2023 · 1 comment

Comments

@snandos
Copy link

snandos commented Feb 8, 2023

First let me thank you for your library to workaround the shortcomings of TypeScript formatting by eslint!

My project uses vue2 with single-file components (*.vue) where this plugin tries to format these files like they were regular typescript files which obviously leads to a syntax desaster in the <template> and <style> sections of those files.

Am I correct, that this eslint plugin is not yet aware of sfc vue files, or am I maybe doing something wrong in my configuration?

I'm quite new to eslint and typescript tooling, so I'm only guessing: might it be possible to use some logic which already is implemented in libraries like vue-tsc?

My workaround for now is a change in this pluginfile to omit typescript compiler formatting on files ending with .vue.

@snandos snandos changed the title Vue2 and single-file components (SFC) Vue2 single-file components (SFC) support Feb 8, 2023
@witcher112
Copy link
Owner

Hi,

I'm glad the package works for you!

You can restrict the scope of the plugin by using the overrides field. Here's some information about it: https://stackoverflow.com/questions/34764287/turning-off-eslint-rule-for-a-specific-file/65069069#65069069

Regarding .vue files, can you send me a package example with plugins/rules that support them?

This way I can take a look at the source code and apply the same technique to handle this case :)

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