uilint-eslint 0.2.165 → 0.2.167
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +60 -2
- package/dist/index.js +398 -66
- package/dist/index.js.map +1 -1
- package/dist/rules/consistent-dark-mode.js +317 -1
- package/dist/rules/consistent-dark-mode.js.map +1 -1
- package/dist/rules/enforce-absolute-imports.js +317 -1
- package/dist/rules/enforce-absolute-imports.js.map +1 -1
- package/dist/rules/no-any-in-props.js +317 -1
- package/dist/rules/no-any-in-props.js.map +1 -1
- package/dist/rules/no-direct-store-import.js +317 -1
- package/dist/rules/no-direct-store-import.js.map +1 -1
- package/dist/rules/no-mixed-component-libraries.js +329 -13
- package/dist/rules/no-mixed-component-libraries.js.map +1 -1
- package/dist/rules/no-prop-drilling-depth.js +317 -1
- package/dist/rules/no-prop-drilling-depth.js.map +1 -1
- package/dist/rules/no-raw-ui-elements.js +331 -15
- package/dist/rules/no-raw-ui-elements.js.map +1 -1
- package/dist/rules/no-secrets-in-code.js +317 -1
- package/dist/rules/no-secrets-in-code.js.map +1 -1
- package/dist/rules/no-unsafe-type-casts.js +317 -1
- package/dist/rules/no-unsafe-type-casts.js.map +1 -1
- package/dist/rules/prefer-store-selectors.js +317 -1
- package/dist/rules/prefer-store-selectors.js.map +1 -1
- package/dist/rules/prefer-tailwind.js +336 -20
- package/dist/rules/prefer-tailwind.js.map +1 -1
- package/dist/rules/prefer-zustand-state-management.js +317 -1
- package/dist/rules/prefer-zustand-state-management.js.map +1 -1
- package/dist/rules/require-input-validation.js +317 -1
- package/dist/rules/require-input-validation.js.map +1 -1
- package/dist/rules/zustand-use-selectors.js +317 -1
- package/dist/rules/zustand-use-selectors.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +12 -0
- package/src/utils/create-rule.ts +121 -2
- package/src/utils/rule-profiler.test.ts +167 -0
- package/src/utils/rule-profiler.ts +398 -0
package/dist/index.d.ts
CHANGED
|
@@ -8,9 +8,10 @@ export { ResolverFactory } from 'oxc-resolver';
|
|
|
8
8
|
* Rule creation helper using @typescript-eslint/utils
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
declare const
|
|
11
|
+
declare const baseCreateRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener> & {
|
|
12
12
|
name: string;
|
|
13
13
|
};
|
|
14
|
+
declare const createRule: typeof baseCreateRule;
|
|
14
15
|
/**
|
|
15
16
|
* Schema for prompting user to configure a rule option in the CLI
|
|
16
17
|
*/
|
|
@@ -278,6 +279,63 @@ declare function clearCache$1(projectRoot: string): void;
|
|
|
278
279
|
*/
|
|
279
280
|
declare function clearAllSuggestions(projectRoot: string): void;
|
|
280
281
|
|
|
282
|
+
/**
|
|
283
|
+
* Lightweight process-local profiling for UILint ESLint rules.
|
|
284
|
+
*
|
|
285
|
+
* The profiler is intentionally quiet during linting: visitor callbacks only
|
|
286
|
+
* update in-memory aggregates, and summaries are flushed once at process exit.
|
|
287
|
+
*/
|
|
288
|
+
interface RuleProfilerOptions {
|
|
289
|
+
enabled: boolean;
|
|
290
|
+
profileDir: string;
|
|
291
|
+
outlierLimit: number;
|
|
292
|
+
minOutlierMs: number;
|
|
293
|
+
}
|
|
294
|
+
interface RuleProfileListenerSummary {
|
|
295
|
+
selector: string;
|
|
296
|
+
totalMs: number;
|
|
297
|
+
calls: number;
|
|
298
|
+
}
|
|
299
|
+
interface RuleProfileSummary {
|
|
300
|
+
ruleId: string;
|
|
301
|
+
files: number;
|
|
302
|
+
reports: number;
|
|
303
|
+
setupMs: number;
|
|
304
|
+
listenerMs: number;
|
|
305
|
+
totalMs: number;
|
|
306
|
+
listenerCalls: number;
|
|
307
|
+
avgFileMs: number;
|
|
308
|
+
p95FileMs: number;
|
|
309
|
+
p99FileMs: number;
|
|
310
|
+
maxFileMs: number;
|
|
311
|
+
listeners: RuleProfileListenerSummary[];
|
|
312
|
+
}
|
|
313
|
+
interface RuleProfileOutlier {
|
|
314
|
+
ruleId: string;
|
|
315
|
+
filePath: string;
|
|
316
|
+
totalMs: number;
|
|
317
|
+
setupMs: number;
|
|
318
|
+
listenerMs: number;
|
|
319
|
+
listenerCalls: number;
|
|
320
|
+
reports: number;
|
|
321
|
+
}
|
|
322
|
+
interface RuleProfileSession {
|
|
323
|
+
version: number;
|
|
324
|
+
generatedAt: string;
|
|
325
|
+
durationMs: number;
|
|
326
|
+
cwd: string;
|
|
327
|
+
nodeVersion: string;
|
|
328
|
+
fileCount: number;
|
|
329
|
+
enabledRuleCount: number;
|
|
330
|
+
rules: RuleProfileSummary[];
|
|
331
|
+
outliers: RuleProfileOutlier[];
|
|
332
|
+
}
|
|
333
|
+
declare function getRuleProfilerOptions(): RuleProfilerOptions;
|
|
334
|
+
declare function buildRuleProfileSession(): RuleProfileSession;
|
|
335
|
+
declare function flushRuleProfiler(): RuleProfileSession | null;
|
|
336
|
+
declare function resetRuleProfilerForTests(now?: () => bigint): void;
|
|
337
|
+
declare function setRuleProfilerNowForTests(now: () => bigint): void;
|
|
338
|
+
|
|
281
339
|
/**
|
|
282
340
|
* Component Parser
|
|
283
341
|
*
|
|
@@ -702,4 +760,4 @@ interface UILintESLint {
|
|
|
702
760
|
*/
|
|
703
761
|
declare const uilintEslint: UILintESLint;
|
|
704
762
|
|
|
705
|
-
export { type CacheEntry, type CacheStore, type CachedIssue, type CategoryMeta, type LibraryName, type OptionFieldSchema, type RuleMeta, type RuleMeta as RuleMetadata, type RuleMigration, type RuleOptionSchema, type RuleRequirement, type UILintESLint, categoryRegistry, clearAllSuggestions, clearCache$1 as clearCache, clearCacheEntry, clearExternalRules, clearCache as clearImportGraphCache, configs, createRule, uilintEslint as default, defineRuleMeta, findStyleguidePath, getAllRuleIds, getCacheEntry, getCategoryMeta, getComponentLibrary, getExternalRules, getPluginCategories, getRuleDocs, getRuleMetadata, getRulesByCategory, getStyleguide, hashContent, hashContentSync, loadCache, loadStyleguide, meta, plugin, registerCategory, registerESLintRule, registerRuleMeta, registerRuleMetas, ruleRegistry, rules, saveCache, setCacheEntry };
|
|
763
|
+
export { type CacheEntry, type CacheStore, type CachedIssue, type CategoryMeta, type LibraryName, type OptionFieldSchema, type RuleMeta, type RuleMeta as RuleMetadata, type RuleMigration, type RuleOptionSchema, type RuleProfileOutlier, type RuleProfileSession, type RuleProfileSummary, type RuleRequirement, type UILintESLint, buildRuleProfileSession, categoryRegistry, clearAllSuggestions, clearCache$1 as clearCache, clearCacheEntry, clearExternalRules, clearCache as clearImportGraphCache, configs, createRule, uilintEslint as default, defineRuleMeta, findStyleguidePath, flushRuleProfiler, getAllRuleIds, getCacheEntry, getCategoryMeta, getComponentLibrary, getExternalRules, getPluginCategories, getRuleDocs, getRuleMetadata, getRuleProfilerOptions, getRulesByCategory, getStyleguide, hashContent, hashContentSync, loadCache, loadStyleguide, meta, plugin, registerCategory, registerESLintRule, registerRuleMeta, registerRuleMetas, resetRuleProfilerForTests, ruleRegistry, rules, saveCache, setCacheEntry, setRuleProfilerNowForTests };
|