MCPcopy Create free account
hub / github.com/angular/components / ruleFn

Function ruleFn

tools/stylelint/selector-no-deep.ts:14–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12 * Stylelint plugin that prevents uses of /deep/ in selectors.
13 */
14const ruleFn: Rule<boolean, unknown> = isEnabled => {
15 return (root, result) => {
16 if (!isEnabled) {
17 return;
18 }
19
20 root.walkRules(rule => {
21 if (
22 rule.parent?.type === 'rule' &&
23 isStandardSyntaxRule(rule) &&
24 isStandardSyntaxSelector(rule.selector) &&
25 rule.selector.includes('/deep/')
26 ) {
27 utils.report({
28 result,
29 ruleName,
30 message: messages.expected(rule.selector),
31 node: rule,
32 });
33 }
34 });
35 };
36};
37
38ruleFn.ruleName = ruleName;
39ruleFn.messages = messages;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected