From 416d00c13c416a3529f712f3dd8cd0fbf63ea909 Mon Sep 17 00:00:00 2001 From: Astrael1 <33071364+Astrael1@users.noreply.github.com> Date: Mon, 7 Oct 2024 23:33:40 +0200 Subject: [PATCH] Report warnings if they weren't fixed by autofix in `properties-alphabetical-order` (#195) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #115 Co-authored-by: Szymon MaƂolepszy --- rules/properties-alphabetical-order/index.js | 3 +++ rules/properties-alphabetical-order/tests/index.js | 6 ------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/rules/properties-alphabetical-order/index.js b/rules/properties-alphabetical-order/index.js index 4c3d7af..44b1288 100644 --- a/rules/properties-alphabetical-order/index.js +++ b/rules/properties-alphabetical-order/index.js @@ -37,6 +37,9 @@ export function rule(actual, options, context = {}) { if (isRuleWithNodes(node)) { if (context.fix) { sortNodeProperties(node, { order: 'alphabetical' }); + + // log warnings if any problems weren't fixed + checkNode(node, result, ruleName, messages); } else { checkNode(node, result, ruleName, messages); } diff --git a/rules/properties-alphabetical-order/tests/index.js b/rules/properties-alphabetical-order/tests/index.js index 4f5260c..5bb160e 100644 --- a/rules/properties-alphabetical-order/tests/index.js +++ b/rules/properties-alphabetical-order/tests/index.js @@ -205,8 +205,6 @@ testRule({ message: messages.expected('color', 'top'), }, { - // blocked by https://github.com/hudochenkov/stylelint-order/issues/115 - skip: true, code: ` const Component = styled.div\` top: 0; @@ -218,8 +216,6 @@ testRule({ message: messages.expected('color', 'top'), }, { - // blocked by https://github.com/hudochenkov/stylelint-order/issues/115 - skip: true, code: ` const Component = styled.div\` top: 0; @@ -236,8 +232,6 @@ testRule({ message: messages.expected('color', 'top'), }, { - // blocked by https://github.com/hudochenkov/stylelint-order/issues/115 - skip: true, code: ` const Component = styled.div\` color: tomato;