@antebudimir/eslint-plugin-vanilla-extract
Version:
Comprehensive ESLint plugin for vanilla-extract with CSS property ordering, style validation, and best practices enforcement. Supports alphabetical, concentric and custom CSS ordering, auto-fixing, and zero-runtime safety.
61 lines (60 loc) • 1.59 kB
TypeScript
export interface TokenInfo {
value: string;
tokenPath: string;
category: 'color' | 'spacing' | 'fontSize' | 'borderRadius' | 'borderWidth' | 'shadow' | 'zIndex' | 'opacity' | 'fontWeight' | 'transition' | 'other';
}
export interface ThemeContract {
tokens: Map<string, TokenInfo[]>;
variableName: string;
}
/**
* Analyzes theme contract files to extract token values and their paths
*/
export declare class ThemeContractAnalyzer {
private contracts;
private evaluator;
/**
* Set rem base for evaluation (default: 16)
*/
setRemBase(base: number): void;
/**
* Load and analyze a theme contract file
*/
loadThemeContract(filePath: string, baseDir: string): void;
/**
* Parse theme contract from source code
*/
private parseThemeContract;
/**
* Parse theme object and extract token values
*/
private parseThemeObject;
/**
* Categorize a token based on its path and value
*/
private categorizeToken;
/**
* Check if a value is a color
*/
private isColor;
/**
* Normalize a value for comparison
*/
private normalizeValue;
/**
* Find matching tokens for a given value and category
*/
findMatchingTokens(value: string, category?: TokenInfo['category']): TokenInfo[];
/**
* Get the primary variable name from loaded contracts
*/
getVariableName(): string;
/**
* Check if any contracts are loaded
*/
hasContracts(): boolean;
/**
* Clear all loaded contracts
*/
clear(): void;
}