| 9 | * Stylelint plugin that prevents nesting Sass mixins. |
| 10 | */ |
| 11 | const ruleFn: Rule<boolean, unknown> = isEnabled => { |
| 12 | return (root, result) => { |
| 13 | if (!isEnabled) { |
| 14 | return; |
| 15 | } |
| 16 | |
| 17 | root.walkAtRules(rule => { |
| 18 | if (rule.name !== 'mixin') { |
| 19 | return; |
| 20 | } |
| 21 | |
| 22 | rule.walkAtRules(childRule => { |
| 23 | if (childRule.name !== 'mixin') { |
| 24 | return; |
| 25 | } |
| 26 | |
| 27 | utils.report({ |
| 28 | result, |
| 29 | ruleName, |
| 30 | message: messages.expected(), |
| 31 | node: childRule, |
| 32 | }); |
| 33 | }); |
| 34 | }); |
| 35 | }; |
| 36 | }; |
| 37 | |
| 38 | ruleFn.ruleName = ruleName; |
| 39 | ruleFn.messages = messages; |
nothing calls this directly
no outgoing calls
no test coverage detected