uilint-eslint 0.2.32 → 0.2.34
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 +67 -5
- package/dist/index.js +387 -59
- package/dist/index.js.map +1 -1
- package/dist/rules/consistent-dark-mode.js +3 -0
- package/dist/rules/consistent-dark-mode.js.map +1 -1
- package/dist/rules/consistent-spacing.js +3 -0
- package/dist/rules/consistent-spacing.js.map +1 -1
- package/dist/rules/enforce-absolute-imports.js +3 -0
- package/dist/rules/enforce-absolute-imports.js.map +1 -1
- package/dist/rules/no-any-in-props.js +3 -0
- package/dist/rules/no-any-in-props.js.map +1 -1
- package/dist/rules/no-arbitrary-tailwind.js +3 -0
- package/dist/rules/no-arbitrary-tailwind.js.map +1 -1
- package/dist/rules/no-direct-store-import.js +3 -0
- package/dist/rules/no-direct-store-import.js.map +1 -1
- package/dist/rules/no-mixed-component-libraries.js +5 -2
- package/dist/rules/no-mixed-component-libraries.js.map +1 -1
- package/dist/rules/no-prop-drilling-depth.js +3 -0
- package/dist/rules/no-prop-drilling-depth.js.map +1 -1
- package/dist/rules/no-secrets-in-code.js +3 -0
- package/dist/rules/no-secrets-in-code.js.map +1 -1
- package/dist/rules/no-semantic-duplicates.js +11 -0
- package/dist/rules/no-semantic-duplicates.js.map +1 -1
- package/dist/rules/prefer-zustand-state-management.js +3 -0
- package/dist/rules/prefer-zustand-state-management.js.map +1 -1
- package/dist/rules/require-input-validation.js +3 -0
- package/dist/rules/require-input-validation.js.map +1 -1
- package/dist/rules/require-test-coverage.js +296 -55
- package/dist/rules/require-test-coverage.js.map +1 -1
- package/dist/rules/semantic-vision.js +4 -0
- package/dist/rules/semantic-vision.js.map +1 -1
- package/dist/rules/semantic.js +15 -0
- package/dist/rules/semantic.js.map +1 -1
- package/dist/rules/zustand-use-selectors.js +3 -0
- package/dist/rules/zustand-use-selectors.js.map +1 -1
- package/package.json +2 -2
- package/src/category-registry.test.ts +75 -0
- package/src/category-registry.ts +50 -0
- package/src/index.ts +4 -2
- package/src/rule-registry.test.ts +214 -0
- package/src/rule-registry.ts +8 -0
- package/src/rules/__fixtures__/coverage/with-chunk-coverage/coverage/coverage-final.json +52 -0
- package/src/rules/__fixtures__/coverage/with-chunk-coverage/src/Button.tsx +13 -0
- package/src/rules/__fixtures__/coverage/with-chunk-coverage/src/useCounter.ts +14 -0
- package/src/rules/__fixtures__/coverage/with-chunk-coverage/src/utils.test.ts +11 -0
- package/src/rules/__fixtures__/coverage/with-chunk-coverage/src/utils.ts +19 -0
- package/src/rules/consistent-dark-mode.ts +3 -0
- package/src/rules/consistent-spacing.ts +3 -0
- package/src/rules/enforce-absolute-imports.ts +3 -0
- package/src/rules/no-any-in-props.ts +3 -0
- package/src/rules/no-arbitrary-tailwind.ts +3 -0
- package/src/rules/no-direct-store-import.ts +3 -0
- package/src/rules/no-mixed-component-libraries/index.ts +5 -1
- package/src/rules/no-prop-drilling-depth.ts +3 -0
- package/src/rules/no-secrets-in-code.ts +3 -0
- package/src/rules/no-semantic-duplicates.ts +11 -0
- package/src/rules/prefer-zustand-state-management.ts +3 -0
- package/src/rules/require-input-validation.ts +3 -0
- package/src/rules/require-test-coverage/index.ts +139 -28
- package/src/rules/require-test-coverage/lib/chunk-analyzer.ts +423 -0
- package/src/rules/require-test-coverage.test.ts +159 -82
- package/src/rules/semantic/index.ts +15 -0
- package/src/rules/semantic-vision.ts +4 -0
- package/src/rules/zustand-use-selectors.ts +3 -0
- package/src/utils/create-rule.ts +30 -0
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,17 @@ interface RuleOptionSchema {
|
|
|
38
38
|
/** Fields that can be configured for this rule */
|
|
39
39
|
fields: OptionFieldSchema[];
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* External requirement that a rule needs to function
|
|
43
|
+
*/
|
|
44
|
+
interface RuleRequirement {
|
|
45
|
+
/** Requirement type for programmatic checks */
|
|
46
|
+
type: "ollama" | "git" | "coverage" | "semantic-index" | "styleguide";
|
|
47
|
+
/** Human-readable description */
|
|
48
|
+
description: string;
|
|
49
|
+
/** Optional: how to satisfy the requirement */
|
|
50
|
+
setupHint?: string;
|
|
51
|
+
}
|
|
41
52
|
/**
|
|
42
53
|
* Colocated rule metadata - exported alongside each rule
|
|
43
54
|
*
|
|
@@ -55,6 +66,18 @@ interface RuleMeta {
|
|
|
55
66
|
defaultSeverity: "error" | "warn" | "off";
|
|
56
67
|
/** Category for grouping in CLI */
|
|
57
68
|
category: "static" | "semantic";
|
|
69
|
+
/** Icon for display in CLI/UI (emoji or icon name) */
|
|
70
|
+
icon?: string;
|
|
71
|
+
/** Short hint about the rule type/requirements */
|
|
72
|
+
hint?: string;
|
|
73
|
+
/** Whether rule is enabled by default during install */
|
|
74
|
+
defaultEnabled?: boolean;
|
|
75
|
+
/** External requirements the rule needs */
|
|
76
|
+
requirements?: RuleRequirement[];
|
|
77
|
+
/** Instructions to show after installation */
|
|
78
|
+
postInstallInstructions?: string;
|
|
79
|
+
/** Framework compatibility */
|
|
80
|
+
frameworks?: ("next" | "vite" | "cra" | "remix")[];
|
|
58
81
|
/** Whether this rule requires a styleguide file */
|
|
59
82
|
requiresStyleguide?: boolean;
|
|
60
83
|
/** Default options for the rule (passed as second element in ESLint config) */
|
|
@@ -221,6 +244,37 @@ declare function getComponentLibrary(contextFilePath: string, componentName: str
|
|
|
221
244
|
*/
|
|
222
245
|
declare function clearCache(): void;
|
|
223
246
|
|
|
247
|
+
/**
|
|
248
|
+
* Category Registry
|
|
249
|
+
*
|
|
250
|
+
* Centralized metadata for rule categories.
|
|
251
|
+
* Used by CLI installers and UI components to display category information
|
|
252
|
+
* without hardcoding assumptions.
|
|
253
|
+
*/
|
|
254
|
+
/**
|
|
255
|
+
* Metadata for a rule category
|
|
256
|
+
*/
|
|
257
|
+
interface CategoryMeta {
|
|
258
|
+
/** Category identifier */
|
|
259
|
+
id: "static" | "semantic";
|
|
260
|
+
/** Display name */
|
|
261
|
+
name: string;
|
|
262
|
+
/** Short description */
|
|
263
|
+
description: string;
|
|
264
|
+
/** Icon for display (emoji) */
|
|
265
|
+
icon: string;
|
|
266
|
+
/** Whether rules in this category are enabled by default during install */
|
|
267
|
+
defaultEnabled: boolean;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Registry of all rule categories
|
|
271
|
+
*/
|
|
272
|
+
declare const categoryRegistry: CategoryMeta[];
|
|
273
|
+
/**
|
|
274
|
+
* Get metadata for a specific category
|
|
275
|
+
*/
|
|
276
|
+
declare function getCategoryMeta(id: string): CategoryMeta | undefined;
|
|
277
|
+
|
|
224
278
|
/**
|
|
225
279
|
* Rule Registry
|
|
226
280
|
*
|
|
@@ -665,7 +719,7 @@ declare const rules: {
|
|
|
665
719
|
}], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
666
720
|
name: string;
|
|
667
721
|
};
|
|
668
|
-
"require-test-coverage": _typescript_eslint_utils_ts_eslint.RuleModule<"
|
|
722
|
+
"require-test-coverage": _typescript_eslint_utils_ts_eslint.RuleModule<"noCoverage" | "belowThreshold" | "noCoverageData" | "belowAggregateThreshold" | "jsxBelowThreshold" | "chunkBelowThreshold" | "untestedFunction", [{
|
|
669
723
|
coveragePath?: string;
|
|
670
724
|
threshold?: number;
|
|
671
725
|
thresholdsByPattern?: Array<{
|
|
@@ -673,7 +727,6 @@ declare const rules: {
|
|
|
673
727
|
threshold: number;
|
|
674
728
|
}>;
|
|
675
729
|
severity?: {
|
|
676
|
-
noTestFile?: "error" | "warn" | "off";
|
|
677
730
|
noCoverage?: "error" | "warn" | "off";
|
|
678
731
|
belowThreshold?: "error" | "warn" | "off";
|
|
679
732
|
};
|
|
@@ -685,6 +738,11 @@ declare const rules: {
|
|
|
685
738
|
aggregateSeverity?: "error" | "warn" | "off";
|
|
686
739
|
jsxThreshold?: number;
|
|
687
740
|
jsxSeverity?: "error" | "warn" | "off";
|
|
741
|
+
chunkCoverage?: boolean;
|
|
742
|
+
chunkThreshold?: number;
|
|
743
|
+
focusNonReact?: boolean;
|
|
744
|
+
relaxedThreshold?: number;
|
|
745
|
+
chunkSeverity?: "error" | "warn" | "off";
|
|
688
746
|
}], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
689
747
|
name: string;
|
|
690
748
|
};
|
|
@@ -801,7 +859,7 @@ declare const plugin: {
|
|
|
801
859
|
}], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
802
860
|
name: string;
|
|
803
861
|
};
|
|
804
|
-
"require-test-coverage": _typescript_eslint_utils_ts_eslint.RuleModule<"
|
|
862
|
+
"require-test-coverage": _typescript_eslint_utils_ts_eslint.RuleModule<"noCoverage" | "belowThreshold" | "noCoverageData" | "belowAggregateThreshold" | "jsxBelowThreshold" | "chunkBelowThreshold" | "untestedFunction", [{
|
|
805
863
|
coveragePath?: string;
|
|
806
864
|
threshold?: number;
|
|
807
865
|
thresholdsByPattern?: Array<{
|
|
@@ -809,7 +867,6 @@ declare const plugin: {
|
|
|
809
867
|
threshold: number;
|
|
810
868
|
}>;
|
|
811
869
|
severity?: {
|
|
812
|
-
noTestFile?: "error" | "warn" | "off";
|
|
813
870
|
noCoverage?: "error" | "warn" | "off";
|
|
814
871
|
belowThreshold?: "error" | "warn" | "off";
|
|
815
872
|
};
|
|
@@ -821,6 +878,11 @@ declare const plugin: {
|
|
|
821
878
|
aggregateSeverity?: "error" | "warn" | "off";
|
|
822
879
|
jsxThreshold?: number;
|
|
823
880
|
jsxSeverity?: "error" | "warn" | "off";
|
|
881
|
+
chunkCoverage?: boolean;
|
|
882
|
+
chunkThreshold?: number;
|
|
883
|
+
focusNonReact?: boolean;
|
|
884
|
+
relaxedThreshold?: number;
|
|
885
|
+
chunkSeverity?: "error" | "warn" | "off";
|
|
824
886
|
}], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
825
887
|
name: string;
|
|
826
888
|
};
|
|
@@ -844,4 +906,4 @@ interface UILintESLint {
|
|
|
844
906
|
*/
|
|
845
907
|
declare const uilintEslint: UILintESLint;
|
|
846
908
|
|
|
847
|
-
export { type AggregatedCoverage, type CacheEntry, type CacheStore, type CachedIssue, type CoverageStats, type DependencyGraph, type FileCategory, type FileCategoryResult, type FileCoverageInfo, type IstanbulCoverage, type IstanbulFileCoverage, type JSXCoverageResult, type LibraryName, type OptionFieldSchema, type RuleMeta, type RuleMeta as RuleMetadata, type RuleOptionSchema, type SourceLocation, type UILintESLint, aggregateCoverage, analyzeJSXElementCoverage, buildDataLoc, buildDependencyGraph, calculateCoverageFromStatements, categorizeFile, clearCache$1 as clearCache, clearCacheEntry, clearCache as clearImportGraphCache, configs, createRule, uilintEslint as default, defineRuleMeta, findCoverageForFile, findStatementsInRange, findStyleguidePath, getAllRuleIds, getCacheEntry, getComponentLibrary, getRuleDocs, getRuleMetadata, getRulesByCategory, getStyleguide, hashContent, hashContentSync, isEventHandlerAttribute, loadCache, loadStyleguide, meta, plugin, ruleRegistry, rules, saveCache, setCacheEntry };
|
|
909
|
+
export { type AggregatedCoverage, type CacheEntry, type CacheStore, type CachedIssue, type CategoryMeta, type CoverageStats, type DependencyGraph, type FileCategory, type FileCategoryResult, type FileCoverageInfo, type IstanbulCoverage, type IstanbulFileCoverage, type JSXCoverageResult, type LibraryName, type OptionFieldSchema, type RuleMeta, type RuleMeta as RuleMetadata, type RuleOptionSchema, type RuleRequirement, type SourceLocation, type UILintESLint, aggregateCoverage, analyzeJSXElementCoverage, buildDataLoc, buildDependencyGraph, calculateCoverageFromStatements, categorizeFile, categoryRegistry, clearCache$1 as clearCache, clearCacheEntry, clearCache as clearImportGraphCache, configs, createRule, uilintEslint as default, defineRuleMeta, findCoverageForFile, findStatementsInRange, findStyleguidePath, getAllRuleIds, getCacheEntry, getCategoryMeta, getComponentLibrary, getRuleDocs, getRuleMetadata, getRulesByCategory, getStyleguide, hashContent, hashContentSync, isEventHandlerAttribute, loadCache, loadStyleguide, meta, plugin, ruleRegistry, rules, saveCache, setCacheEntry };
|