@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.
29 lines (28 loc) • 1.3 kB
TypeScript
import { TSESTree } from '@typescript-eslint/utils';
/**
* Extracts the name of a property from a TSESTree.Property node.
* @param property The property node to extract the name from.
* @returns The name of the property as a string, or an empty string if the name cannot be determined.
*
* This function handles two types of property keys:
* - Identifier: Returns the name directly.
* - Literal (string): Returns the string value.
* For any other type of key, it returns an empty string.
*/
export declare const getPropertyNameForSorting: (property: TSESTree.Property) => string;
/**
* Separates object properties into regular and special categories.
* @param properties An array of object literal elements to be categorized.
* @returns An object containing two arrays: regularProperties and specialProperties.
*
* This function categorizes properties as follows:
* - Regular properties: Standard CSS properties.
* - Special properties: Properties that start with ':' (pseudo-selectors),
* '@' (at-rules), or are named 'selectors'.
*
* Non-Property type elements in the input array are ignored.
*/
export declare const separateProperties: (properties: TSESTree.ObjectLiteralElement[]) => {
regularProperties: TSESTree.Property[];
specialProperties: TSESTree.Property[];
};