@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.
16 lines (15 loc) • 884 B
TypeScript
import type { Rule } from 'eslint';
import { TSESTree } from '@typescript-eslint/utils';
/**
* Processes a style object to enforce alphabetical ordering of CSS properties.
*
* This function handles different types of style objects:
* 1. If the object is invalid or not an ObjectExpression, it returns immediately.
* 2. For 'selectors' objects, it processes nested selectors recursively.
* 3. For regular style objects, it separates and enforces alphabetical order on properties.
* 4. It always processes nested objects recursively, regardless of type.
*
* @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 enforceAlphabeticalCSSOrderInStyleObject: (ruleContext: Rule.RuleContext, styleObject: TSESTree.ObjectExpression) => void;