UNPKG

stylelint-scss

Version:

A collection of SCSS-specific rules for Stylelint

24 lines (19 loc) 590 B
"use strict"; const hasInterpolation = require("./hasInterpolation"); const isStandardSyntaxSelector = require("./isStandardSyntaxSelector"); /** * Check whether a selector is standard * * @param {string} selector * @return {boolean} If `true`, the selector is standard */ module.exports = function (selector) { const standardSyntaxSelector = isStandardSyntaxSelector(selector); // SCSS placeholder selectors if (!standardSyntaxSelector) { if (selector.indexOf("%") === 0 && !hasInterpolation(selector)) { return true; } } return standardSyntaxSelector; };