Provide an option of vue/html-indent to disable the indentation level of 1
See original GitHub issueTell us about your environment
- ESLint Version:4.13.1
- eslint-plugin-vue Version:4.0.0-beta.2
- Node Version:8.9.1
Please show your full configuration:
{
extends: 'plugin:vue/recommended',
parser: 'vue-eslint-parser',
plugins: ['vue'],
rules: {
'vue/html-indent': [2, 4, {
attribute: 1,
closeBracket: 0,
}],
}
}
What did you do? Please include the actual source code causing the issue.
<template>
<div class="article">
<div v-if="foo"></div>
<slot></slot>
</div>
</template>
<script>
export default {
name: 'article',
};
</script>
What did you expect to happen?
<template>
<div class="article">
<div v-if="foo"></div>
<slot></slot>
</div>
</template>
<script>
export default {
name: 'article',
};
</script>
What actually happened? Please include the actual, raw output from ESLint.
I don’t want to indent first level node of <template>
because it’s inconsistent with that in <script>
. And sometimes I have to concat no-indentation *.html, *.js, *.css into *.vue. That means that I want they are in the same format.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:5 (3 by maintainers)
Top Results From Across the Web
vue/html-indent
This rule enforces a consistent indentation style in <template> . The default style is 2 spaces. This rule checks all tags, also all...
Read more >eslint insists on not indenting <script> tag
In your .eslintrc.js, add a rule for "vue/script-indent" and turn off the "indent" rule for .vue files. There's options to configure ...
Read more >indent - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Vue.js | PyCharm Documentation
PyCharm provides support for the Vue.js building blocks of HTML, CSS, and JavaScript with ... By default, code within top-level tags is indented...
Read more >Content formatting options | Docs
However, when trying to match the format to remove or update the UI, the other ... option allows specification of the indentation level...
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 proposal.
I can do. I’m writing
vue/script-indent
rule which hasbaseIndent
option now. We can reuse the option forvue/html-indent
.Hey @mysticatea , I think reusing
baseIndent
option is a good way. Is this work in progress? Thanks!