Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: allow more pseudo classes",
"packageName": "@fluentui-contrib/stylelint-plugin",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Copy link
Contributor

@ling1726 ling1726 Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this be updated to a rule config to remove the dependency on a code release for users?


export const ruleName = normalizeRuleName('combinator-depth');

const messages = stylelint.utils.ruleMessages(ruleName, {
Expand Down Expand Up @@ -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;
Expand Down