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: [ {