Skip to content

Provide an option of vue/html-indent to disable the indentation level of 1 #292

Closed
@z-ZYS-s

Description

@z-ZYS-s

Tell 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions