-
-
Notifications
You must be signed in to change notification settings - Fork 669
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
vue/block-lang
do not support enforcement of lang attritbutes for default langauges
#2606
Comments
In my personal use case, I've never encountered this. If the As for the |
I don't think that adding However, I think that it should already be possible to enforce always adding the I agree the docs are not super clear about this, so a PR to improve them is certainly welcome 🙂 |
I agree. So, the issue that @NVolcz must add
Actually, no. The test case in the following image is incorrect. Because If the value of eslint-plugin-vue/lib/rules/block-lang.js Line 87 in 16c8778
According to the documentation's note, this is due to compatibility with |
Checklist
Tell us about your environment
Please show your full configuration:
What did you do?
When using vscode with the "Vue - official" (vue.volar) extension in a Vite setup the Intellisense does not assume that the default language is JavaScript. In order to work around this limitation I was thinking of using the 'vue/block-lang` to enforce that a language is specified for every script block.
Formatting files like:
What did you expect to happen?
I expected rule to honor my settings to require script blocks to specify
lang="js"
.What actually happened?
The rule outputs errors regarding the default language is specified:
Based on my understanding of the rule's code, if an default language is specified, then omitting the language is preferred:
eslint-plugin-vue/lib/rules/block-lang.js
Lines 60 to 89 in 16c8778
It seems that this assumption was valid when Vetur was used for the official vscode extension:
eslint-plugin-vue/docs/rules/block-lang.md
Lines 57 to 62 in 16c8778
It would be nice if the Vue vscode extension were better at handling the lang attribtue but I also feel that this rule shouldn't be as opinionated as it is now.
Repository to reproduce this issue
The text was updated successfully, but these errors were encountered: