eslint-plugin-clsx
Version:
An ESLint plugin for clsx/classnames
15 lines (12 loc) • 790 B
TypeScript
import { TSESTree } from '@typescript-eslint/types';
import { SourceCode, RuleContext } from '@typescript-eslint/utils/ts-eslint';
type ClsxOptions = Record<string, string | string[]>;
declare function chunkBy<T>(collection: T[], chunker: (el: T) => unknown): T[][];
declare function findClsxImport(importNode: TSESTree.ImportDeclaration, clsxOptions: ClsxOptions): string[] | undefined;
declare function getClsxUsages(importNode: TSESTree.ImportDeclaration, sourceCode: SourceCode, assignedClsxNames: string[]): (TSESTree.CallExpression & {
callee: {
name: string;
};
})[];
declare function extractClsxOptions<M extends string, O extends readonly unknown[]>(context: RuleContext<M, O>): ClsxOptions;
export { chunkBy, extractClsxOptions, findClsxImport, getClsxUsages };