From f020d17e95dd0586875f1b1f85bd0646527a69fe Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Mon, 7 Aug 2017 13:24:23 +0900 Subject: [PATCH 1/5] New: `vue/html-indent` rule (fixes #46) --- .vscode/settings.json | 3 +- docs/rules/html-indent.md | 115 + lib/rules/html-indent.js | 1228 ++++++++++ package.json | 3 +- tests/lib/rules/html-indent.js | 4214 ++++++++++++++++++++++++++++++++ 5 files changed, 5561 insertions(+), 2 deletions(-) create mode 100644 docs/rules/html-indent.md create mode 100644 lib/rules/html-indent.js create mode 100644 tests/lib/rules/html-indent.js diff --git a/.vscode/settings.json b/.vscode/settings.json index ce072c82c..d8d7006c0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "editor.tabSize": 2 + "editor.tabSize": 2, + "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true } diff --git a/docs/rules/html-indent.md b/docs/rules/html-indent.md new file mode 100644 index 000000000..5e42dc0c1 --- /dev/null +++ b/docs/rules/html-indent.md @@ -0,0 +1,115 @@ +# enforce consistent indentation in ` `, + unIndent` + + `, // SwitchStatement, SwitchCase unIndent` @@ -3338,6 +3347,31 @@ tester.run('html-indent', rule, { { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 18 } ] }, + { + code: unIndent` + + `, + output: unIndent` + + `, + errors: [ + { message: 'Expected indentation of 8 spaces but found 4 spaces.', line: 3 }, + { message: 'Expected indentation of 8 spaces but found 4 spaces.', line: 4 }, + { message: 'Expected indentation of 8 spaces but found 4 spaces.', line: 5 } + ] + }, // SwitchStatement, SwitchCase { From 0cdb709265cc3eaeb7755d11bb568f82dfb4398d Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Thu, 21 Sep 2017 18:45:11 +0900 Subject: [PATCH 4/5] remove switchCase option from docs --- docs/rules/html-indent.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/rules/html-indent.md b/docs/rules/html-indent.md index 5e42dc0c1..aeb632de3 100644 --- a/docs/rules/html-indent.md +++ b/docs/rules/html-indent.md @@ -58,7 +58,6 @@ This rule enforces a consistent indentation style in `