Skip to content

Commit

Permalink
v1.0.88
Browse files Browse the repository at this point in the history
Improve html indent
  • Loading branch information
eliottvincent committed Jun 22, 2024
1 parent b768d19 commit adc136b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-crisp",
"version": "1.0.87",
"version": "1.0.88",
"description": "Custom ESLint Rules for Crisp",
"author": "Crisp IM SAS",
"main": "index.js",
Expand Down
14 changes: 14 additions & 0 deletions rules/vue-html-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ module.exports = {
return;
}

// Odd number of spaces?
if (node.loc.start.column % 2 !== 0) {
report(
node,
"element",

`${node.loc.start.column - 1} or ${node.loc.start.column + 1}`,
node.loc.start.column
);

// Abort here as the whole element is not indented correctly
return;
}

// Skip singleline element (no indentation to check)
if (node.loc.start.line === node.loc.end.line) {
return;
Expand Down

0 comments on commit adc136b

Please sign in to comment.