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.

21 lines (20 loc) 1.31 kB
import type { Rule } from 'eslint'; import type { SortRemainingProperties } from '../concentric-order/types.js'; import type { OrderingStrategy } from '../types.js'; /** * Creates an ESLint rule listener with visitors for style-related function calls. * @param ruleContext The ESLint rule context. * @param orderingStrategy The strategy to use for ordering CSS properties ('alphabetical', 'concentric', or 'userDefinedGroupOrder'). * @param userDefinedGroupOrder An optional array of property groups for the 'userDefinedGroupOrder' strategy. * @param sortRemainingProperties An optional strategy for sorting properties not in user-defined groups. * @returns An object with visitor functions for the ESLint rule. * * This function sets up visitors for the following cases: * 1. The fontFace and globalFontFace functions. * 2. Style-related functions: 'keyframes', 'style', 'styleVariants'. * 3. The 'globalStyle' and 'globalKeyframes' function * 4. The 'recipe' function * * Each visitor applies the appropriate ordering strategy to the style objects in these function calls. */ export declare const createNodeVisitors: (ruleContext: Rule.RuleContext, orderingStrategy: OrderingStrategy, userDefinedGroupOrder?: string[], sortRemainingProperties?: SortRemainingProperties) => Rule.RuleListener;