-
-
Notifications
You must be signed in to change notification settings - Fork 682
script-indent make me crazy!!!!!!! #362
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
Thank you for the report. But it looks to be the errors of core indent rule rather than our vue/script-indent rule. If you use
|
J just try to configuring rules as 'vue/script-indent': ['warn', 2, {
'baseIndent': 1
}] <script>
// attension here. it is about 2 indent before javascript code
export default {
name: 'App'
}
</script> It still show the error ✘ http://eslint.org/docs/rules/indent Expected indentation of 0 spaces but found 2
src\App.vue:10:1
export default {
^
... Instead, I did removed the indent before the javascript code. It showed warnings below ⚠ https://google.com/#q=vue%2Fscript-indent Expected indentation of 2 spaces but found 0 spaces
src\App.vue:10:1
export default {
^
⚠ https://google.com/#q=vue%2Fscript-indent Expected indentation of 4 spaces but found 2 spaces
src\App.vue:11:1
name: 'App'
^ I do really have no ideas about these , please help me! (⊙o⊙) |
|
All right! It seems to be possible. thank you very much . |
I spent much time to know why dose these code warned me const router = [];
new Vue({
router
}) I awake to know that you've said
So , i am still perplexed.Forgive me! I am still have no idea... (⊙o⊙) |
That bug has been fixed in #346, but we have not released it yet. Please wait for the next release... Closing since it's fixed on |
Sorry for late release.. Enjoy :) https://github.com/vuejs/eslint-plugin-vue/releases/tag/v4.2.1 |
Thank you for your bug fixed. |
If you are using webstorm, you can |
When working with module.exports = {
root: true,
env: {
node: true,
},
'extends': [
'plugin:vue/strongly-recommended'
],
rules: {
'indent': ['error', 2],
'vue/script-indent': [
'error',
2,
{ 'baseIndent': 1 }
],
},
'overrides': [
{
'files': ['*.vue'],
'rules': {
'indent': 'off'
}
}
]
}; |
Just faced this problem changed this: "vue/script-indent": [
"error",
"tab",
{
"baseIndent": 1
}
] to this: "vue": {
"script-indent": [
"error",
"tab",
{
"baseIndent": 1
}
]
} and problem solved |
@mysticatea
What am I missing? Thank you |
Why not just include |
this is not best solution |
I never said it's the best solution. It seems to work well for me, and might work for others too. |
ofcourse it works |
Why this issue is closed? Mega bug - still happens. My solution - remove this plugin and wait for better options (Or fixing this issues - one extra space in your code throw
|
@apoorvpatne10 Why use eslint in the first place if you need to disable it in all your files 🤯 @begueradj You need to use the indent rule I think
|
If you are using WebStorm or PhpStrom by JetBrains open setting by
Editor->Code Style -> Javascript Select checkbox Do not let ESLint to decide how many tabs should be and keep it simple like so
ESlint just checks that tabs are used |
For last Webstorm versions |
This bug still exists when using Volar with Vite and format document.
/* eslint-env node */
module.exports = {
root: true,
extends: [
"eslint:recommended",
'plugin:vue/base',
'plugin:vue/vue3-essential',
'plugin:vue/vue3-recommended',
'plugin:vue/vue3-strongly-recommended',
'@vue/typescript/recommended',
"@vue/eslint-config-typescript/recommended",
],
rules: {
"indent": ["error", 4],
"vue/html-indent": ["error", 4, {
"attribute": 1,
"baseIndent": 1,
"closeBracket": 0,
"alignAttributesVertically": true,
"ignores": []
}],
"vue/script-indent": ["error", 4, {
"baseIndent": 1,
"switchCase": 1,
"ignores": []
}],
},
overrides: [
{
files: ['*.vue'],
rules: {
indent: 'off'
}
}
]
}; Before fixing the problems:After fixing using Code Actions:Using Volar Document Formatter -> Back to the same problem!Any way to make Volar compatible with the “vue/script-indent” rule? |
Tell us about your environment
^4.15.0
^4.0.0
^8.9.0
webstorm 2017.2.5
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
What actually happened? Please include the actual, raw output from ESLint.
This happend when i command in
npm run dev
As you can see above. This is not my expect things. Does any config to avoid these happen?
Otherwise, i may closing the indent config.although it is not a good experience.
The text was updated successfully, but these errors were encountered: