slopbrick 0.21.2 → 0.25.0
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/README.md +72 -0
- package/dist/engine/worker.cjs +1521 -12
- package/dist/engine/worker.js +1522 -13
- package/dist/index.cjs +1927 -90
- package/dist/index.d.cts +35 -1
- package/dist/index.d.ts +35 -1
- package/dist/index.js +1953 -117
- package/package.json +5 -2
package/dist/index.d.cts
CHANGED
|
@@ -737,6 +737,27 @@ interface RuleContext {
|
|
|
737
737
|
supportsRsc?: boolean;
|
|
738
738
|
hotspotIssues?: Issue[];
|
|
739
739
|
}
|
|
740
|
+
/**
|
|
741
|
+
* v0.25.0: self-scan excludes. When `selfScan.excludePaths` is set, the
|
|
742
|
+
* scan worker skips files whose workspace-relative path matches any of
|
|
743
|
+
* the glob patterns. This is for *self-scanning* the slopbrick repo
|
|
744
|
+
* itself, where rule definitions (`src/rules/**`) and test fixtures
|
|
745
|
+
* (`tests/fixtures/**`, `tests/rules/**`) are meta-code — the rules
|
|
746
|
+
* contain examples of the patterns they detect (self-fire), and test
|
|
747
|
+
* fixtures contain intentional bad code that the rules must fire on
|
|
748
|
+
* to be useful. Both are false positives in the self-scan context.
|
|
749
|
+
*
|
|
750
|
+
* Default excludes (in `config/defaults.ts`) cover exactly these three
|
|
751
|
+
* paths. Users who scan a *different* repo can leave `selfScan` unset
|
|
752
|
+
* (or set `excludePaths: []`) to opt out. Empty array disables; absent
|
|
753
|
+
* field uses defaults.
|
|
754
|
+
*/
|
|
755
|
+
interface ScanSelfScanConfig {
|
|
756
|
+
/** Glob patterns (minimatch) to exclude from the scan. Matched against
|
|
757
|
+
* the workspace-relative POSIX-style path. Dot files are matched
|
|
758
|
+
* (`{ dot: true }` semantics). */
|
|
759
|
+
excludePaths: string[];
|
|
760
|
+
}
|
|
740
761
|
interface Rule<Context = unknown> {
|
|
741
762
|
id: string;
|
|
742
763
|
category: Category;
|
|
@@ -832,6 +853,19 @@ interface ResolvedConfig {
|
|
|
832
853
|
/** Walk production AST to find branches without test coverage. */
|
|
833
854
|
missingEdgeCase?: boolean;
|
|
834
855
|
};
|
|
856
|
+
/**
|
|
857
|
+
* v0.25.0: self-scan exclude paths. Applied at scan time (in
|
|
858
|
+
* `engine/worker.ts`) so files matching any glob in `excludePaths`
|
|
859
|
+
* short-circuit with empty issues. Defaults (in `config/defaults.ts`)
|
|
860
|
+
* cover the three "always false positive in self-scan" paths:
|
|
861
|
+
* rule definitions (`src/rules/**`), test fixtures
|
|
862
|
+
* (`tests/fixtures/**`), and rule test files (`tests/rules/**`).
|
|
863
|
+
*
|
|
864
|
+
* Empty array `excludePaths: []` disables exclusion entirely
|
|
865
|
+
* (legacy behavior — every file is scanned). Unset field uses
|
|
866
|
+
* defaults.
|
|
867
|
+
*/
|
|
868
|
+
selfScan?: ScanSelfScanConfig;
|
|
835
869
|
}
|
|
836
870
|
|
|
837
871
|
/**
|
|
@@ -1578,4 +1612,4 @@ declare function formatBadge(report: ProjectReport): string;
|
|
|
1578
1612
|
/** Render an array of values as a Unicode sparkline (▁▂▃▄▅▆▇█). */
|
|
1579
1613
|
declare function formatSparkline(values: number[]): string;
|
|
1580
1614
|
|
|
1581
|
-
export { AI_SECURITY_NUMERIC, type AiDebt, type AiMaintenanceCost, type AiMaintenanceCostResult, type AstroComponentFact, type AutoTunedRule, type BaselineCache, type BaselineMeta, type CachedFile, type Category, type ClassNameFact, type CommentFact, type ComponentFacts, type ComponentScore, type ComponentSizeFact, type ConsoleCallFact, type Constitution, DEFAULT_CONFIG, type DangerouslySetInnerHtmlFact, type DbDriftLevel, type DbFinding, type DialogCallFact, type DisabledLintRuleFact, type DocDriftLevel, type DocFinding, type DomQueryFact, type ElementFact, type EvalCallFact, type ExplicitAnyFact, type FetchCallFact, type FileScanResult, type FixSuggestion, type FlywheelOutput, type FlywheelState, type Framework$1 as Framework, type HealthFile, type HookCallFact, type HookDependencyArrayFact, type HookFact, type ImportFact, type InlineEventHandlerFact, type Issue, type JsxAttributeStringLiteralFact, type JsxTextLiteralFact, type KeyPropFact, type LogicalExpressionFact, type MagicNumberSpacingConfig, type MaintenanceAxes, type MaintenanceAxisHealth, type NonNullAssertionFact, type OptimisticUpdateFact, type ProjectReport, type PropMutationFact, type PropPassThroughFact, REPOSITORY_HEALTH_WEIGHTS, type ReportReadResult, type RepositoryHealth, type RepositoryHealthInputs, type ResearchMetrics, type ResolvedConfig, type Rule, type RuleContext, type RuleSeverity, type RuleSuggestion, type ScanCache, type ScanFacts, type ScanProjectOptions, type Severity, type SlopAuditRun, type StateBinding, type StateBindingFact, type StringLiteralFact, type StylePropFact, type TamaguiStylePropFact, type TopOffender, type UseEffectBodyFact, VERSION, baselineStatusMessage, colorForSlop, failedThresholdCount, filterByDisabledDirectives, filterIssues, formatBadge, formatReportFromFile, formatSparkline, loadConfig, readReportFile, runCli, runInitWizard, scanProject, serializeConfig, stagedGating, thresholdExceeded };
|
|
1615
|
+
export { AI_SECURITY_NUMERIC, type AiDebt, type AiMaintenanceCost, type AiMaintenanceCostResult, type AstroComponentFact, type AutoTunedRule, type BaselineCache, type BaselineMeta, type CachedFile, type Category, type ClassNameFact, type CommentFact, type ComponentFacts, type ComponentScore, type ComponentSizeFact, type ConsoleCallFact, type Constitution, DEFAULT_CONFIG, type DangerouslySetInnerHtmlFact, type DbDriftLevel, type DbFinding, type DialogCallFact, type DisabledLintRuleFact, type DocDriftLevel, type DocFinding, type DomQueryFact, type ElementFact, type EvalCallFact, type ExplicitAnyFact, type FetchCallFact, type FileScanResult, type FixSuggestion, type FlywheelOutput, type FlywheelState, type Framework$1 as Framework, type HealthFile, type HookCallFact, type HookDependencyArrayFact, type HookFact, type ImportFact, type InlineEventHandlerFact, type Issue, type JsxAttributeStringLiteralFact, type JsxTextLiteralFact, type KeyPropFact, type LogicalExpressionFact, type MagicNumberSpacingConfig, type MaintenanceAxes, type MaintenanceAxisHealth, type NonNullAssertionFact, type OptimisticUpdateFact, type ProjectReport, type PropMutationFact, type PropPassThroughFact, REPOSITORY_HEALTH_WEIGHTS, type ReportReadResult, type RepositoryHealth, type RepositoryHealthInputs, type ResearchMetrics, type ResolvedConfig, type Rule, type RuleContext, type RuleSeverity, type RuleSuggestion, type ScanCache, type ScanFacts, type ScanProjectOptions, type ScanSelfScanConfig, type Severity, type SlopAuditRun, type StateBinding, type StateBindingFact, type StringLiteralFact, type StylePropFact, type TamaguiStylePropFact, type TopOffender, type UseEffectBodyFact, VERSION, baselineStatusMessage, colorForSlop, failedThresholdCount, filterByDisabledDirectives, filterIssues, formatBadge, formatReportFromFile, formatSparkline, loadConfig, readReportFile, runCli, runInitWizard, scanProject, serializeConfig, stagedGating, thresholdExceeded };
|
package/dist/index.d.ts
CHANGED
|
@@ -737,6 +737,27 @@ interface RuleContext {
|
|
|
737
737
|
supportsRsc?: boolean;
|
|
738
738
|
hotspotIssues?: Issue[];
|
|
739
739
|
}
|
|
740
|
+
/**
|
|
741
|
+
* v0.25.0: self-scan excludes. When `selfScan.excludePaths` is set, the
|
|
742
|
+
* scan worker skips files whose workspace-relative path matches any of
|
|
743
|
+
* the glob patterns. This is for *self-scanning* the slopbrick repo
|
|
744
|
+
* itself, where rule definitions (`src/rules/**`) and test fixtures
|
|
745
|
+
* (`tests/fixtures/**`, `tests/rules/**`) are meta-code — the rules
|
|
746
|
+
* contain examples of the patterns they detect (self-fire), and test
|
|
747
|
+
* fixtures contain intentional bad code that the rules must fire on
|
|
748
|
+
* to be useful. Both are false positives in the self-scan context.
|
|
749
|
+
*
|
|
750
|
+
* Default excludes (in `config/defaults.ts`) cover exactly these three
|
|
751
|
+
* paths. Users who scan a *different* repo can leave `selfScan` unset
|
|
752
|
+
* (or set `excludePaths: []`) to opt out. Empty array disables; absent
|
|
753
|
+
* field uses defaults.
|
|
754
|
+
*/
|
|
755
|
+
interface ScanSelfScanConfig {
|
|
756
|
+
/** Glob patterns (minimatch) to exclude from the scan. Matched against
|
|
757
|
+
* the workspace-relative POSIX-style path. Dot files are matched
|
|
758
|
+
* (`{ dot: true }` semantics). */
|
|
759
|
+
excludePaths: string[];
|
|
760
|
+
}
|
|
740
761
|
interface Rule<Context = unknown> {
|
|
741
762
|
id: string;
|
|
742
763
|
category: Category;
|
|
@@ -832,6 +853,19 @@ interface ResolvedConfig {
|
|
|
832
853
|
/** Walk production AST to find branches without test coverage. */
|
|
833
854
|
missingEdgeCase?: boolean;
|
|
834
855
|
};
|
|
856
|
+
/**
|
|
857
|
+
* v0.25.0: self-scan exclude paths. Applied at scan time (in
|
|
858
|
+
* `engine/worker.ts`) so files matching any glob in `excludePaths`
|
|
859
|
+
* short-circuit with empty issues. Defaults (in `config/defaults.ts`)
|
|
860
|
+
* cover the three "always false positive in self-scan" paths:
|
|
861
|
+
* rule definitions (`src/rules/**`), test fixtures
|
|
862
|
+
* (`tests/fixtures/**`), and rule test files (`tests/rules/**`).
|
|
863
|
+
*
|
|
864
|
+
* Empty array `excludePaths: []` disables exclusion entirely
|
|
865
|
+
* (legacy behavior — every file is scanned). Unset field uses
|
|
866
|
+
* defaults.
|
|
867
|
+
*/
|
|
868
|
+
selfScan?: ScanSelfScanConfig;
|
|
835
869
|
}
|
|
836
870
|
|
|
837
871
|
/**
|
|
@@ -1578,4 +1612,4 @@ declare function formatBadge(report: ProjectReport): string;
|
|
|
1578
1612
|
/** Render an array of values as a Unicode sparkline (▁▂▃▄▅▆▇█). */
|
|
1579
1613
|
declare function formatSparkline(values: number[]): string;
|
|
1580
1614
|
|
|
1581
|
-
export { AI_SECURITY_NUMERIC, type AiDebt, type AiMaintenanceCost, type AiMaintenanceCostResult, type AstroComponentFact, type AutoTunedRule, type BaselineCache, type BaselineMeta, type CachedFile, type Category, type ClassNameFact, type CommentFact, type ComponentFacts, type ComponentScore, type ComponentSizeFact, type ConsoleCallFact, type Constitution, DEFAULT_CONFIG, type DangerouslySetInnerHtmlFact, type DbDriftLevel, type DbFinding, type DialogCallFact, type DisabledLintRuleFact, type DocDriftLevel, type DocFinding, type DomQueryFact, type ElementFact, type EvalCallFact, type ExplicitAnyFact, type FetchCallFact, type FileScanResult, type FixSuggestion, type FlywheelOutput, type FlywheelState, type Framework$1 as Framework, type HealthFile, type HookCallFact, type HookDependencyArrayFact, type HookFact, type ImportFact, type InlineEventHandlerFact, type Issue, type JsxAttributeStringLiteralFact, type JsxTextLiteralFact, type KeyPropFact, type LogicalExpressionFact, type MagicNumberSpacingConfig, type MaintenanceAxes, type MaintenanceAxisHealth, type NonNullAssertionFact, type OptimisticUpdateFact, type ProjectReport, type PropMutationFact, type PropPassThroughFact, REPOSITORY_HEALTH_WEIGHTS, type ReportReadResult, type RepositoryHealth, type RepositoryHealthInputs, type ResearchMetrics, type ResolvedConfig, type Rule, type RuleContext, type RuleSeverity, type RuleSuggestion, type ScanCache, type ScanFacts, type ScanProjectOptions, type Severity, type SlopAuditRun, type StateBinding, type StateBindingFact, type StringLiteralFact, type StylePropFact, type TamaguiStylePropFact, type TopOffender, type UseEffectBodyFact, VERSION, baselineStatusMessage, colorForSlop, failedThresholdCount, filterByDisabledDirectives, filterIssues, formatBadge, formatReportFromFile, formatSparkline, loadConfig, readReportFile, runCli, runInitWizard, scanProject, serializeConfig, stagedGating, thresholdExceeded };
|
|
1615
|
+
export { AI_SECURITY_NUMERIC, type AiDebt, type AiMaintenanceCost, type AiMaintenanceCostResult, type AstroComponentFact, type AutoTunedRule, type BaselineCache, type BaselineMeta, type CachedFile, type Category, type ClassNameFact, type CommentFact, type ComponentFacts, type ComponentScore, type ComponentSizeFact, type ConsoleCallFact, type Constitution, DEFAULT_CONFIG, type DangerouslySetInnerHtmlFact, type DbDriftLevel, type DbFinding, type DialogCallFact, type DisabledLintRuleFact, type DocDriftLevel, type DocFinding, type DomQueryFact, type ElementFact, type EvalCallFact, type ExplicitAnyFact, type FetchCallFact, type FileScanResult, type FixSuggestion, type FlywheelOutput, type FlywheelState, type Framework$1 as Framework, type HealthFile, type HookCallFact, type HookDependencyArrayFact, type HookFact, type ImportFact, type InlineEventHandlerFact, type Issue, type JsxAttributeStringLiteralFact, type JsxTextLiteralFact, type KeyPropFact, type LogicalExpressionFact, type MagicNumberSpacingConfig, type MaintenanceAxes, type MaintenanceAxisHealth, type NonNullAssertionFact, type OptimisticUpdateFact, type ProjectReport, type PropMutationFact, type PropPassThroughFact, REPOSITORY_HEALTH_WEIGHTS, type ReportReadResult, type RepositoryHealth, type RepositoryHealthInputs, type ResearchMetrics, type ResolvedConfig, type Rule, type RuleContext, type RuleSeverity, type RuleSuggestion, type ScanCache, type ScanFacts, type ScanProjectOptions, type ScanSelfScanConfig, type Severity, type SlopAuditRun, type StateBinding, type StateBindingFact, type StringLiteralFact, type StylePropFact, type TamaguiStylePropFact, type TopOffender, type UseEffectBodyFact, VERSION, baselineStatusMessage, colorForSlop, failedThresholdCount, filterByDisabledDirectives, filterIssues, formatBadge, formatReportFromFile, formatSparkline, loadConfig, readReportFile, runCli, runInitWizard, scanProject, serializeConfig, stagedGating, thresholdExceeded };
|