From 014ab12ec1227105b9f7315c858a0a7b84603e5a Mon Sep 17 00:00:00 2001 From: FlorentinBouchendhomme Date: Thu, 16 Jan 2025 15:48:00 +0100 Subject: [PATCH] Add the missing handlings for the closing script and style tags and two tests --- .../eslint-plugin/lib/rules/indent/indent.js | 2 ++ .../eslint-plugin/tests/rules/indent.test.js | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/packages/eslint-plugin/lib/rules/indent/indent.js b/packages/eslint-plugin/lib/rules/indent/indent.js index 69ce6f3..67a3232 100644 --- a/packages/eslint-plugin/lib/rules/indent/indent.js +++ b/packages/eslint-plugin/lib/rules/indent/indent.js @@ -271,6 +271,7 @@ module.exports = { }, OpenScriptTagStart: checkIndent, OpenScriptTagEnd: checkIndent, + CloseScriptTag: checkIndent, StyleTag(node) { indentLevel.indent(node); }, @@ -279,6 +280,7 @@ module.exports = { }, OpenStyleTagStart: checkIndent, OpenStyleTagEnd: checkIndent, + CloseStyleTag: checkIndent, OpenTagStart: checkIndent, OpenTagEnd(node) { checkIndent(node); diff --git a/packages/eslint-plugin/tests/rules/indent.test.js b/packages/eslint-plugin/tests/rules/indent.test.js index 36d33a2..66ea350 100644 --- a/packages/eslint-plugin/tests/rules/indent.test.js +++ b/packages/eslint-plugin/tests/rules/indent.test.js @@ -374,6 +374,14 @@ function createTests() { }, ], }, + { + code: ` + + + ` + } ], invalid: [ { @@ -1053,6 +1061,21 @@ id="bar" }, ], }, + { + code: ` + + + `, + output: ` + + + `, + errors: wrongIndentErrors(2), + } ], }; }