You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improved closing bracket indentation for vue/html-indent rule. (#1162)
- Added `closeBracket.startTag`, `closeBracket.endTag` and `closeBracket.selfClosingTag` options to `vue/html-indent` rule.
So that the closeBracket offset value can be set for each tag type.
- Changed `vue/html-indent` rule to calculate the base point of the indent offset of the closing bracket of the end tag by the start tag.
Copy file name to clipboardExpand all lines: docs/rules/html-indent.md
+5-1
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,11 @@ This rule enforces a consistent indentation style in `<template>`. The default s
76
76
-`type` (`number | "tab"`) ... The type of indentation. Default is `2`. If this is a number, it's the number of spaces for one indent. If this is `"tab"`, it uses one tab for one indent.
77
77
-`attribute` (`integer`) ... The multiplier of indentation for attributes. Default is `1`.
78
78
-`baseIndent` (`integer`) ... The multiplier of indentation for top-level statements. Default is `1`.
79
-
-`closeBracket` (`integer`) ... The multiplier of indentation for right brackets. Default is `0`.
79
+
-`closeBracket` (`integer | object`) ... The multiplier of indentation for right brackets. Default is `0`.
80
+
You can apply all of the following by setting a number value.
81
+
-`closeBracket.startTag` (`integer`) ... The multiplier of indentation for right brackets of start tags (`<div>`). Default is `0`.
82
+
-`closeBracket.endTag` (`integer`) ... The multiplier of indentation for right brackets of end tags (`</div>`). Default is `0`.
83
+
-`closeBracket.selfClosingTag` (`integer`) ... The multiplier of indentation for right brackets of start tags (`<div/>`). Default is `0`.
80
84
-`alignAttributesVertically` (`boolean`) ... Condition for whether attributes should be vertically aligned to the first attribute in multiline case or not. Default is `true`
81
85
-`ignores` (`string[]`) ... The selector to ignore nodes. The AST spec is [here](https://github.com/mysticatea/vue-eslint-parser/blob/master/docs/ast.md). You can use [esquery](https://github.com/estools/esquery#readme) to select nodes. Default is an empty array.
0 commit comments