Skip to content

closeBracket affects end tag #728

Closed
@IlyaSemenov

Description

@IlyaSemenov

Tell us about your environment

  • ESLint version: 5.10.0
  • eslint-plugin-vue version: 5.0.0
  • Node version: 10.10.0

Please show your full configuration:

module.exports = {
	root: true,
	plugins: ['vue'],
	extends: [
		'plugin:vue/essential',
	],
	rules: {
		'vue/html-indent': [
			'error',
			'tab',
			{
				closeBracket: 1,
			},
		],
	},
}

What did you do?

<template>
	<div>
		<a
			>alksjdklaj dklajsd klaj dklajs kldjaksljdkals jdklas
			jdkljaklsdjkalsjdklajskldjaskl jdklasjdklajslkdja</a
		>
	</div>
</template>

yarn eslint --fix test.vue && cat test.vue

The example deliberately has no whitespace between <a>/</a> and inner text (this is how it happens in real life - links don't typically have side spaces).

What did you expect to happen?

<template>
	<div>
		<a
			>alksjdklaj dklajsd klaj dklajs kldjaksljdkals jdklas
			jdkljaklsdjkalsjdklajskldjaskl jdklasjdklajslkdja</a
		>
	</div>
</template>

What actually happened?

yarn run v1.10.1
$ /Users/semenov/xxx/node_modules/.bin/eslint --fix test.vue
✨  Done in 0.75s.
<template>
	<div>
		<a
			>alksjdklaj dklajsd klaj dklajs kldjaksljdkals jdklas
			jdkljaklsdjkalsjdklajskldjaskl jdklasjdklajslkdja</a
			>
	</div>
</template>

I would expect closeBracket not to affect the end tag's indentation as it doesn't make sense (the whole <a>...</a> element becomes unbalanced).

Alternatively, there should be an option to disable closeBracket for end tags separately.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions