UNPKG

stylelint

Version:

A mighty CSS linter that helps you avoid errors and enforce conventions.

26 lines (21 loc) 531 B
import { isRule } from './typeGuards.mjs'; import isStandardSyntaxSelector from './isStandardSyntaxSelector.mjs'; /** * Check whether a Node is a standard rule * * @param {import('postcss').Rule | import('postcss-less').Rule} rule * @returns {boolean} */ export default function isStandardSyntaxRule(rule) { if (!isRule(rule)) { return false; } // Ignore Less &:extend rule if ('extend' in rule && rule.extend) { return false; } if (!isStandardSyntaxSelector(rule.selector)) { return false; } return true; }