From e8ea057e132edea2a62e20fadcb91a75e86e53fd Mon Sep 17 00:00:00 2001 From: Pixel998 Date: Mon, 24 Aug 2026 23:15:40 +0300 Subject: [PATCH] fix: crash in `no-important` on non-standard important values --- src/rules/no-important.js | 2 +- tests/rules/no-important.test.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rules/no-important.js b/src/rules/no-important.js index dc63aa04..b79af589 100644 --- a/src/rules/no-important.js +++ b/src/rules/no-important.js @@ -51,7 +51,7 @@ export default /** @satisfies {NoImportantRuleDefinition} */ ({ return { Declaration(node) { - if (node.important) { + if (node.important === true) { const declarationText = sourceCode.getText(node); const textWithoutComments = declarationText.replace( commentPattern, diff --git a/tests/rules/no-important.test.js b/tests/rules/no-important.test.js index be6ee62f..e14ba964 100644 --- a/tests/rules/no-important.test.js +++ b/tests/rules/no-important.test.js @@ -50,6 +50,9 @@ ruleTester.run("no-important", rule, { "a { color: red /* !important */; }", "a { color: /* !important */ red; }", "a { color: red; /* !important */ background: blue; }", + "a { color: red !ie; }", + "a { color: red !IE7; }", + "a { color: red !important\\9; }", ], invalid: [ {