@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.
26 lines (25 loc) • 1.36 kB
TypeScript
import type { Rule } from 'eslint';
import { TSESTree } from '@typescript-eslint/utils';
/**
* Determines if the given object node is a 'selectors' object within a style definition.
* @param objectNode The object expression node to check.
* @returns True if the node is a 'selectors' object, false otherwise.
*
* This function checks if:
* 1. The node has a parent
* 2. The parent is a Property node
* 3. The parent's key is an Identifier
* 4. The parent's key name is 'selectors'
*/
export declare const isSelectorsObject: (objectNode: TSESTree.ObjectExpression) => boolean;
/**
* Processes nested selectors within a 'selectors' object by recursively validating their value objects.
* @param context The ESLint rule context.
* @param objectNode The object expression node representing the 'selectors' object.
* @param validateFn A function to validate each nested selector's value object.
*
* This function iterates through each property of the 'selectors' object:
* - If a property's value is an ObjectExpression, it applies the validateFn to that object.
* - This allows for validation of nested style objects within selectors.
*/
export declare const processNestedSelectors: (context: Rule.RuleContext, objectNode: TSESTree.ObjectExpression, validateFn: (context: Rule.RuleContext, objectNode: TSESTree.ObjectExpression) => void) => void;