[vue/html-indent] wrong indentation reported with just one prop/attr
See original GitHub issueTell us about your environment
- ESLint Version: 4.16.0
- eslint-plugin-vue Version: 4.2.2
Please show your full configuration:
module.exports = {
root: true,
extends: [
'plugin:vue/recommended'
],
parserOptions: {
parser: 'babel-eslint'
},
plugins: ['vue'],
rules: {
'vue/html-indent': ['error', 2, {
alignAttributesVertically: true
}],
'vue/html-self-closing': ['error', {
html: {
void: 'never',
normal: 'never',
component: 'never'
}
}],
'vue/max-attributes-per-line': ['error', {
singleline: 3,
multiline: {
max: 1,
allowFirstLine: false,
}
}],
},
};
What did you do? Please include the actual source code causing the issue.
<template>
<div>
<my-component
:foo="true">
</my-component>
</div>
</template>
What did you expect to happen?
I expect vue/html-indent error to not being reported in that case
What actually happened? Please include the actual, raw output from ESLint.
4:1 Expected indentation of 4 spaces but found 6 spaces. (vue/html-indent)
But if you add another prop after foo then it works as expected:
<my-component
:foo="true"
:bar="false">
</my-component>
Am i missing something in my configuration? 🤔
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
vue/html-indent
This rule enforces a consistent indentation style in <template> . ... If this is a number, it's the number of spaces for one...
Read more >vue eslint html,[vue/html-indent] wrong indentation reported ...
Hi,. The versions are: "eslint-plugin-vue": "4.2.2",. "vue-eslint-parser": "2.0.2". and our .eslintrc.js file contains:.
Read more >Wrong indentation of <script> and <style> in .vue files
Content of <script> and <style> are indented. Workaround: Add "script" and "style" entries into settings "Editor > Code Style > HTML | Other...
Read more >@vue/eslint-plugin - npm
Start using @vue/eslint-plugin in your project by running `npm i ... @vue/html-indent, enforce consistent indentation in <template>.
Read more >Changelog - Cypress Documentation
The Chrome web security configuration tooltip will now be shown only if chromeWebSecurity is set to false when using a non-chromium browser. Fixes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for the report.
I confirmed it, and I will fix it.
Hi,
The versions are:
“eslint-plugin-vue”: “4.2.2”, “vue-eslint-parser”: “2.0.2”
and our .eslintrc.js file contains:
Many thanks! 🙏