From f15025e5e896dda0ab46121d6fb6fbaf253e1c49 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Thu, 3 Jul 2025 10:18:38 +0200 Subject: [PATCH 1/2] fix(stylelint-plugin): allow more pseudo classes --- .../src/rules/combinator-depth/combinator-depth.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/stylelint-plugin/src/rules/combinator-depth/combinator-depth.ts b/packages/stylelint-plugin/src/rules/combinator-depth/combinator-depth.ts index 7347464b9..77fce8d0e 100644 --- a/packages/stylelint-plugin/src/rules/combinator-depth/combinator-depth.ts +++ b/packages/stylelint-plugin/src/rules/combinator-depth/combinator-depth.ts @@ -4,6 +4,8 @@ import { extractAllSelectors } from '../../postcss-utils'; import { createRule } from '../../create-rule'; import { normalizeRuleName } from '../../normalize-rule-name'; +const ALLOWED_PSEUDO_CLASSES = [':hover', ':active', ':focus', ':focus-within']; + export const ruleName = normalizeRuleName('combinator-depth'); const messages = stylelint.utils.ruleMessages(ruleName, { @@ -55,7 +57,7 @@ export default createRule({ if ( tokenizedSelector.length > 1 && tokenizedSelector[1].type === 'pseudo-class' && - [':hover', ':active'].includes(tokenizedSelector[1].content) && + ALLOWED_PSEUDO_CLASSES.includes(tokenizedSelector[1].content) && combinatorCount <= allowedDepth + 1 ) { continue; From 099f0c95df592c9c174417a8a11c353f7ef568bd Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Thu, 3 Jul 2025 10:19:41 +0200 Subject: [PATCH 2/2] Change files --- ...lelint-plugin-07a48668-e1bc-4b9b-905e-994574b8380a.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@fluentui-contrib-stylelint-plugin-07a48668-e1bc-4b9b-905e-994574b8380a.json diff --git a/change/@fluentui-contrib-stylelint-plugin-07a48668-e1bc-4b9b-905e-994574b8380a.json b/change/@fluentui-contrib-stylelint-plugin-07a48668-e1bc-4b9b-905e-994574b8380a.json new file mode 100644 index 000000000..04d9b0137 --- /dev/null +++ b/change/@fluentui-contrib-stylelint-plugin-07a48668-e1bc-4b9b-905e-994574b8380a.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix: allow more pseudo classes", + "packageName": "@fluentui-contrib/stylelint-plugin", + "email": "olfedias@microsoft.com", + "dependentChangeType": "patch" +}