4 const _ = require("lodash");
5 const isCustomPropertySet = require("../utils/isCustomPropertySet");
8 * Check whether a Node is a standard rule
10 module.exports = function(rule /*: Object*/) /*: boolean*/ {
12 const selector = _.get(rule, "raws.selector.raw", rule.selector);
14 // Custom property set (e.g. --custom-property-set: {})
15 if (isCustomPropertySet(rule)) {
19 // Called Less mixin (e.g. a { .mixin() })
24 // Less detached rulesets
25 if (selector.slice(0, 1) === "@" && selector.slice(-1) === ":") {
29 // Ignore Less &:extend rule
34 // Ignore mixin or &:extend rule
35 // https://github.com/shellscape/postcss-less/blob/master/lib/less-parser.js#L52
36 if (rule.params && rule.params[0]) {
40 // Non-outputting Less mixin definition (e.g. .mixin() {})
41 if (_.endsWith(selector, ")") && !_.includes(selector, ":")) {
46 if (/when\s+(not\s+)*\(/.test(selector)) {
50 // Ignore Scss nested properties
51 if (selector.slice(-1) === ":") {