Tell us about your environment
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.
Hey, thanks for posting this proposal @rainfore :)
@mysticatea what do you think about this? You worked on this rule, so you should be able to quickly estimate effort needed for such an additional setting.
Personally I think it might be kinda useful, being able to set consistent indentation per different code blocks makes sense.
Thank you for the proposal.
I can do. I'm writing vue/script-indent rule which has baseIndent option now. We can reuse the option for vue/html-indent.
@mysticatea I noticed vue/script-indent was added to the README and appears to have been merged and added to the project. However, after updating to 4.1.0 I don't see it included in the rules folder. Will it be added soon? Thanks so much! =)
Hey @mysticatea , I think reusing baseIndent option is a good way. Is this work in progress?
Thanks!
Most helpful comment
Thank you for the proposal.
I can do. I'm writing
vue/script-indentrule which hasbaseIndentoption now. We can reuse the option forvue/html-indent.