-
-
Notifications
You must be signed in to change notification settings - Fork 441
[feat-req] ability to provide formatter for template, script & style tag like vetur #725
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
Comments
You just need to add eslint-plugin-vue to make ESLint understand .vue files and which parts of it are html and which JS/TS. It will then use the rules you've defined for normal JS/TS files also in Vue. That way, your IDE's ESLint extension will show you the errors, instead of Volar. See here for the extensions. Here's a web demo: https://eslint.vuejs.org/user-guide/#installation (just don't use the @vue/cli option, use "install via npm" since there's no vue cli in vue 3) https://vue-loader.vuejs.org/guide/linting.html#stylelint - this is a link from the Vue 2 days (I think) but stylelint seems to support vue files out of the box. To get linting information in VS Code, see https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint Related: |
Made a demo quickly: https://github.com/sethidden/vue3-eslint-stylelint-demo . Lemme know if there are any problems. Make sure to install the eslint and stylelint exts for vscode |
@jd-0001 similar to #672, we need to with for plugin API(#185) implemented. @sethidden do you want to change vue3-eslint-stylelint-demo to a template repo so that I add it to readme? I think some peoples interested in it. |
@sethidden done. Also added husky for pre-commit linting |
@sethidden added, thank you. :) |
Thanks @sethidden I was able to enable stylelint in SFC after refering to your repo, I just updated {
"extends": [
"stylelint-config-standard-scss"
],
"overrides": [
{
"files": [
"**/*.scss"
],
"customSyntax": "postcss-scss"
},
{
"files": [
"**/*.vue"
],
"customSyntax": "postcss-html"
}
]
} had to install I was already linting my Btw, I am not using prettier because of they don't want to merge this PR. @johnsoncodehk Shall I close this? |
I will close it because already has a similar issue #672. |
Hi,
I am working in a team and I want to keep consistent code across my whole project. For this reason, I am using formatters like stylelint, eslint etc.
I was able to specify which formatter to choose in vetur but this is not the case with volar.
I already mentioned this in the discord channel previously and I was completely satisfied with your response but as the project grows and new team members are introduced, it is getting hard to keep consistency.
Below are some notes, I think providing features like this is important:
I already tried for 2 months without the above feature but I still miss awesome things created by people around the world. Volar will be the future of Vue and I think using popular tools like eslint & stylelint with vue will be great.
I am totally fine if you still don't want to introduce a feature like this or volar later provide this. These are just my thoughts and what I am facing.
Regards.
The text was updated successfully, but these errors were encountered: