UNPKG

stylelint-scss

Version:

A collection of SCSS-specific rules for Stylelint

22 lines (18 loc) 586 B
import hasInterpolation from "./hasInterpolation.js"; import isStandardSyntaxSelector from "./isStandardSyntaxSelector.js"; /** * Check whether a selector is standard * * @param {string} selector * @return {boolean} If `true`, the selector is standard */ export default function isStandardSelector(selector) { const standardSyntaxSelector = isStandardSyntaxSelector(selector); // SCSS placeholder selectors if (!standardSyntaxSelector) { if (selector.indexOf("%") === 0 && !hasInterpolation(selector)) { return true; } } return standardSyntaxSelector; }