UNPKG

@antebudimir/eslint-plugin-vanilla-extract

Version:

ESLint plugin for enforcing best practices in vanilla-extract CSS styles, including CSS property ordering and additional linting rules.

22 lines (21 loc) 1.13 kB
import type { Rule } from 'eslint'; import { TSESTree } from '@typescript-eslint/utils'; /** * Enforces concentric ordering of CSS properties within a style object. * * This function processes the given style object to ensure that CSS properties * follow a concentric order based on predefined priority groups. It handles * different types of style objects by: * 1. Validating that the input is an ObjectExpression. * 2. Processing 'selectors' objects separately and recursively applying the * concentric order enforcement. * 3. Separating regular properties and building a list of CSSPropertyInfo * objects with priority details. * 4. Enforcing concentric order on the properties using their priority * information. * 5. Recursively processing nested selectors and style objects. * * @param ruleContext - The ESLint rule context for reporting and fixing issues. * @param styleObject - The object expression representing the style object to be processed. */ export declare const enforceConcentricCSSOrderInStyleObject: (ruleContext: Rule.RuleContext, styleObject: TSESTree.ObjectExpression) => void;