@ospm/eslint-plugin-react-signals-hooks
Version:
ESLint plugin for React Signals hooks - enforces best practices, performance optimizations, and integration patterns for @preact/signals-react usage in React projects
39 lines • 2 kB
text/typescript
/** biome-ignore-all assist/source/organizeImports: off */
import type { TSESTree } from '@typescript-eslint/utils';
import type { RuleContext } from '@typescript-eslint/utils/ts-eslint';
import { type PerformanceOperationKeys } from './performance-constants.mjs';
import type { PerformanceBudget, PerformanceMetrics } from './types.mjs';
export declare const DEFAULT_PERFORMANCE_BUDGET: {
readonly maxTime: 50;
readonly maxNodes: 2000;
readonly maxMemory: number;
readonly maxOperations: {
readonly signalAccess: 1000;
readonly signalCheck: 500;
readonly effectCheck: 500;
readonly identifierResolution: 1000;
readonly scopeLookup: 1000;
readonly typeCheck: 500;
};
readonly enableMetrics: false;
readonly logMetrics: false;
};
export declare class PerformanceLimitExceededError extends Error {
readonly metric: string;
readonly limit: number;
readonly actual: number;
constructor(metric: string, limit: number, actual: number);
}
export declare const performanceMetrics: Map<string, PerformanceMetrics>;
export declare function startTracking<Options extends Array<unknown>>(context: RuleContext<string, Options>, perfKey: string, budget: PerformanceBudget | undefined, ruleName: string): void;
export declare function trackOperation(key: string, operation: PerformanceOperationKeys, count?: number): void;
export declare function startPhase(key: string, phaseName: string): void;
export declare function endPhase(key: string, phaseName: string): void;
export declare function recordMetric<T>(key: string, name: string, value: T): void;
export declare function stopTracking(key: string): PerformanceMetrics | undefined;
export declare function logMetrics(metrics: PerformanceMetrics): void;
export declare function createPerformanceTracker(key: string, budget: PerformanceBudget | undefined): {
trackNode(node: TSESTree.Node): void;
'Program:exit'(): void;
};
//# sourceMappingURL=performance.d.ts.map