@shivaedev/quality 0.24.0 → 0.26.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/CHANGELOG.md +22 -0
- package/README.md +71 -28
- package/dist/baseline/compare.js +1 -1
- package/dist/baseline/compare.js.map +1 -1
- package/dist/baseline/update.js +3 -3
- package/dist/baseline/update.js.map +1 -1
- package/dist/cli/args.d.ts +1 -3
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +5 -18
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/fix.js +1 -1
- package/dist/cli/fix.js.map +1 -1
- package/dist/cli/lint.d.ts +1 -2
- package/dist/cli/lint.d.ts.map +1 -1
- package/dist/cli/lint.js +1 -2
- package/dist/cli/lint.js.map +1 -1
- package/dist/cli/messages.d.ts +2 -2
- package/dist/cli/messages.d.ts.map +1 -1
- package/dist/cli/messages.js +7 -3
- package/dist/cli/messages.js.map +1 -1
- package/dist/cli/migrate.js +1 -1
- package/dist/cli/migrate.js.map +1 -1
- package/dist/cli/migrateExceptions.js +1 -1
- package/dist/cli/migrateExceptions.js.map +1 -1
- package/dist/cli/program.js +1 -1
- package/dist/cli/program.js.map +1 -1
- package/dist/cli/{run-main.d.ts → runMain.d.ts} +1 -1
- package/dist/cli/runMain.d.ts.map +1 -0
- package/dist/cli/{run-main.js → runMain.js} +1 -1
- package/dist/cli/runMain.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/config/decode.d.ts +0 -2
- package/dist/config/decode.d.ts.map +1 -1
- package/dist/config/decode.js +0 -8
- package/dist/config/decode.js.map +1 -1
- package/dist/config/resolve.d.ts +1 -3
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +1 -1
- package/dist/config/resolve.js.map +1 -1
- package/dist/config.d.ts +2 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/decoded.d.ts +1 -1
- package/dist/decoded.d.ts.map +1 -1
- package/dist/decoded.js +1 -1
- package/dist/decoded.js.map +1 -1
- package/dist/engine/{baseline-file.d.ts → baselineFile.d.ts} +1 -1
- package/dist/engine/baselineFile.d.ts.map +1 -0
- package/dist/engine/{baseline-file.js → baselineFile.js} +1 -1
- package/dist/engine/baselineFile.js.map +1 -0
- package/dist/engine/evaluate.d.ts +0 -1
- package/dist/engine/evaluate.d.ts.map +1 -1
- package/dist/engine/evaluate.js +1 -2
- package/dist/engine/evaluate.js.map +1 -1
- package/dist/engine/{run-rules.d.ts → runRules.d.ts} +1 -1
- package/dist/engine/runRules.d.ts.map +1 -0
- package/dist/engine/{run-rules.js → runRules.js} +2 -2
- package/dist/engine/runRules.js.map +1 -0
- package/dist/engine/session.d.ts +1 -1
- package/dist/engine/session.d.ts.map +1 -1
- package/dist/engine/session.js +2 -2
- package/dist/engine/session.js.map +1 -1
- package/dist/engine/violation.d.ts +1 -1
- package/dist/engine/violation.d.ts.map +1 -1
- package/dist/engine/violation.js +1 -1
- package/dist/engine/violation.js.map +1 -1
- package/dist/hooks/preCommit.js +1 -1
- package/dist/hooks/preCommit.js.map +1 -1
- package/dist/imports/generated.js +1 -1
- package/dist/imports/generated.js.map +1 -1
- package/dist/imports/{pnpm-workspace.d.ts → pnpmWorkspacePatterns.d.ts} +1 -1
- package/dist/imports/pnpmWorkspacePatterns.d.ts.map +1 -0
- package/dist/imports/{pnpm-workspace.js → pnpmWorkspacePatterns.js} +1 -1
- package/dist/imports/pnpmWorkspacePatterns.js.map +1 -0
- package/dist/imports/resolve.js +1 -1
- package/dist/imports/resolve.js.map +1 -1
- package/dist/imports/workspace.js +1 -1
- package/dist/imports/workspace.js.map +1 -1
- package/dist/inventory/collect.js +1 -1
- package/dist/inventory/collect.js.map +1 -1
- package/dist/inventory/{ignore-scope.d.ts → ignoreScope.d.ts} +1 -1
- package/dist/inventory/ignoreScope.d.ts.map +1 -0
- package/dist/inventory/{ignore-scope.js → ignoreScope.js} +1 -1
- package/dist/inventory/ignoreScope.js.map +1 -0
- package/dist/inventory/walk.d.ts +1 -1
- package/dist/inventory/walk.d.ts.map +1 -1
- package/dist/inventory/walk.js +1 -1
- package/dist/inventory/walk.js.map +1 -1
- package/dist/manifests/sorted.js +1 -1
- package/dist/manifests/sorted.js.map +1 -1
- package/dist/report/render.d.ts +0 -2
- package/dist/report/render.d.ts.map +1 -1
- package/dist/report/render.js +6 -16
- package/dist/report/render.js.map +1 -1
- package/dist/report/stale.js +1 -1
- package/dist/report/stale.js.map +1 -1
- package/dist/rule.d.ts +1 -1
- package/dist/rule.d.ts.map +1 -1
- package/dist/rule.js +1 -1
- package/dist/rule.js.map +1 -1
- package/dist/rules/{built-in.d.ts → builtIn.d.ts} +2 -2
- package/dist/rules/builtIn.d.ts.map +1 -0
- package/dist/rules/{built-in.js → builtIn.js} +15 -13
- package/dist/rules/builtIn.js.map +1 -0
- package/dist/rules/comments/{pattern-rule.d.ts → definePattern.d.ts} +1 -1
- package/dist/rules/comments/definePattern.d.ts.map +1 -0
- package/dist/rules/comments/{pattern-rule.js → definePattern.js} +1 -1
- package/dist/rules/comments/definePattern.js.map +1 -0
- package/dist/rules/comments/{max-per-file.d.ts → maxPerFile.d.ts} +1 -1
- package/dist/rules/comments/maxPerFile.d.ts.map +1 -0
- package/dist/rules/comments/{max-per-file.js → maxPerFile.js} +1 -1
- package/dist/rules/comments/maxPerFile.js.map +1 -0
- package/dist/rules/comments/{no-banner.d.ts → noBanner.d.ts} +1 -1
- package/dist/rules/comments/noBanner.d.ts.map +1 -0
- package/dist/rules/comments/{no-banner.js → noBanner.js} +2 -2
- package/dist/rules/comments/noBanner.js.map +1 -0
- package/dist/rules/comments/{no-environment-pragma.d.ts → noEnvironmentPragma.d.ts} +1 -1
- package/dist/rules/comments/noEnvironmentPragma.d.ts.map +1 -0
- package/dist/rules/comments/{no-environment-pragma.js → noEnvironmentPragma.js} +2 -2
- package/dist/rules/comments/noEnvironmentPragma.js.map +1 -0
- package/dist/rules/comments/{no-jsdoc.d.ts → noJsdoc.d.ts} +1 -1
- package/dist/rules/comments/noJsdoc.d.ts.map +1 -0
- package/dist/rules/comments/{no-jsdoc.js → noJsdoc.js} +1 -1
- package/dist/rules/comments/noJsdoc.js.map +1 -0
- package/dist/rules/comments/{no-line-reference.d.ts → noLineReference.d.ts} +1 -1
- package/dist/rules/comments/noLineReference.d.ts.map +1 -0
- package/dist/rules/comments/{no-line-reference.js → noLineReference.js} +2 -2
- package/dist/rules/comments/noLineReference.js.map +1 -0
- package/dist/rules/comments/{no-pr-reference.d.ts → noPrReference.d.ts} +1 -1
- package/dist/rules/comments/noPrReference.d.ts.map +1 -0
- package/dist/rules/comments/{no-pr-reference.js → noPrReference.js} +2 -2
- package/dist/rules/comments/noPrReference.js.map +1 -0
- package/dist/rules/comments/{no-todo.d.ts → noTodo.d.ts} +1 -1
- package/dist/rules/comments/noTodo.d.ts.map +1 -0
- package/dist/rules/comments/{no-todo.js → noTodo.js} +2 -2
- package/dist/rules/comments/noTodo.js.map +1 -0
- package/dist/rules/{manifests-sorted.d.ts → manifestsSorted.d.ts} +1 -1
- package/dist/rules/manifestsSorted.d.ts.map +1 -0
- package/dist/rules/{manifests-sorted.js → manifestsSorted.js} +1 -1
- package/dist/rules/manifestsSorted.js.map +1 -0
- package/dist/rules/manifestsSourceFirst.d.ts +2 -0
- package/dist/rules/manifestsSourceFirst.d.ts.map +1 -0
- package/dist/rules/manifestsSourceFirst.js +43 -0
- package/dist/rules/manifestsSourceFirst.js.map +1 -0
- package/dist/rules/{max-lines.d.ts → maxLines.d.ts} +1 -1
- package/dist/rules/maxLines.d.ts.map +1 -0
- package/dist/rules/{max-lines.js → maxLines.js} +1 -1
- package/dist/rules/maxLines.js.map +1 -0
- package/dist/rules/suppressions/{biome-overrides.d.ts → biomeOverrides.d.ts} +1 -1
- package/dist/rules/suppressions/biomeOverrides.d.ts.map +1 -0
- package/dist/rules/suppressions/{biome-overrides.js → biomeOverrides.js} +1 -1
- package/dist/rules/suppressions/biomeOverrides.js.map +1 -0
- package/dist/rules/suppressions/{no-double-cast.d.ts → noDoubleCast.d.ts} +1 -1
- package/dist/rules/suppressions/noDoubleCast.d.ts.map +1 -0
- package/dist/rules/suppressions/{no-double-cast.js → noDoubleCast.js} +1 -1
- package/dist/rules/suppressions/noDoubleCast.js.map +1 -0
- package/dist/rules/suppressions/noIgnoreDeprecations.js +1 -1
- package/dist/rules/suppressions/noIgnoreDeprecations.js.map +1 -1
- package/dist/rules/suppressions/{no-inline.d.ts → noInline.d.ts} +1 -1
- package/dist/rules/suppressions/noInline.d.ts.map +1 -0
- package/dist/rules/suppressions/{no-inline.js → noInline.js} +2 -2
- package/dist/rules/suppressions/noInline.js.map +1 -0
- package/dist/rules/suppressions/{stylesheet-comments.d.ts → stylesheetComments.d.ts} +1 -1
- package/dist/rules/suppressions/stylesheetComments.d.ts.map +1 -0
- package/dist/rules/suppressions/{stylesheet-comments.js → stylesheetComments.js} +1 -1
- package/dist/rules/suppressions/stylesheetComments.js.map +1 -0
- package/dist/{standard-schema.d.ts → standardSchema.d.ts} +1 -1
- package/dist/standardSchema.d.ts.map +1 -0
- package/dist/{standard-schema.js → standardSchema.js} +1 -1
- package/dist/standardSchema.js.map +1 -0
- package/dist/testProjects.d.ts +1 -1
- package/dist/testProjects.d.ts.map +1 -1
- package/dist/testProjects.js +4 -4
- package/dist/testProjects.js.map +1 -1
- package/docs/debt-and-hooks.md +9 -38
- package/docs/north-star.md +0 -3
- package/package.json +2 -3
- package/src/baseline/compare.ts +1 -1
- package/src/baseline/update.ts +3 -3
- package/src/cli/args.ts +6 -21
- package/src/cli/fix.ts +1 -1
- package/src/cli/lint.ts +1 -3
- package/src/cli/messages.ts +7 -4
- package/src/cli/migrate.ts +1 -1
- package/src/cli/migrateExceptions.ts +1 -1
- package/src/cli/program.ts +1 -1
- package/src/cli.ts +1 -1
- package/src/config/decode.ts +0 -11
- package/src/config/resolve.ts +2 -2
- package/src/config.ts +2 -2
- package/src/decoded.ts +1 -1
- package/src/engine/evaluate.ts +1 -3
- package/src/engine/{run-rules.ts → runRules.ts} +1 -1
- package/src/engine/session.ts +2 -2
- package/src/engine/violation.ts +2 -2
- package/src/hooks/preCommit.ts +1 -1
- package/src/imports/generated.ts +1 -1
- package/src/imports/resolve.ts +1 -1
- package/src/imports/workspace.ts +1 -1
- package/src/inventory/collect.ts +1 -1
- package/src/inventory/walk.ts +1 -1
- package/src/manifests/sorted.ts +1 -1
- package/src/report/render.ts +6 -26
- package/src/report/stale.ts +1 -1
- package/src/rule.ts +1 -1
- package/src/rules/{built-in.ts → builtIn.ts} +14 -12
- package/src/rules/comments/{no-banner.ts → noBanner.ts} +1 -1
- package/src/rules/comments/{no-environment-pragma.ts → noEnvironmentPragma.ts} +1 -1
- package/src/rules/comments/{no-line-reference.ts → noLineReference.ts} +1 -1
- package/src/rules/comments/{no-pr-reference.ts → noPrReference.ts} +1 -1
- package/src/rules/comments/{no-todo.ts → noTodo.ts} +1 -1
- package/src/rules/manifestsSourceFirst.ts +48 -0
- package/src/rules/suppressions/noIgnoreDeprecations.ts +1 -1
- package/src/rules/suppressions/{no-inline.ts → noInline.ts} +1 -1
- package/src/testProjects.ts +4 -4
- package/dist/cli/run-main.d.ts.map +0 -1
- package/dist/cli/run-main.js.map +0 -1
- package/dist/engine/baseline-file.d.ts.map +0 -1
- package/dist/engine/baseline-file.js.map +0 -1
- package/dist/engine/run-rules.d.ts.map +0 -1
- package/dist/engine/run-rules.js.map +0 -1
- package/dist/imports/pnpm-workspace.d.ts.map +0 -1
- package/dist/imports/pnpm-workspace.js.map +0 -1
- package/dist/inventory/ignore-scope.d.ts.map +0 -1
- package/dist/inventory/ignore-scope.js.map +0 -1
- package/dist/rules/built-in.d.ts.map +0 -1
- package/dist/rules/built-in.js.map +0 -1
- package/dist/rules/comments/max-per-file.d.ts.map +0 -1
- package/dist/rules/comments/max-per-file.js.map +0 -1
- package/dist/rules/comments/no-banner.d.ts.map +0 -1
- package/dist/rules/comments/no-banner.js.map +0 -1
- package/dist/rules/comments/no-environment-pragma.d.ts.map +0 -1
- package/dist/rules/comments/no-environment-pragma.js.map +0 -1
- package/dist/rules/comments/no-jsdoc.d.ts.map +0 -1
- package/dist/rules/comments/no-jsdoc.js.map +0 -1
- package/dist/rules/comments/no-line-reference.d.ts.map +0 -1
- package/dist/rules/comments/no-line-reference.js.map +0 -1
- package/dist/rules/comments/no-pr-reference.d.ts.map +0 -1
- package/dist/rules/comments/no-pr-reference.js.map +0 -1
- package/dist/rules/comments/no-todo.d.ts.map +0 -1
- package/dist/rules/comments/no-todo.js.map +0 -1
- package/dist/rules/comments/pattern-rule.d.ts.map +0 -1
- package/dist/rules/comments/pattern-rule.js.map +0 -1
- package/dist/rules/manifests-sorted.d.ts.map +0 -1
- package/dist/rules/manifests-sorted.js.map +0 -1
- package/dist/rules/max-lines.d.ts.map +0 -1
- package/dist/rules/max-lines.js.map +0 -1
- package/dist/rules/suppressions/biome-overrides.d.ts.map +0 -1
- package/dist/rules/suppressions/biome-overrides.js.map +0 -1
- package/dist/rules/suppressions/no-double-cast.d.ts.map +0 -1
- package/dist/rules/suppressions/no-double-cast.js.map +0 -1
- package/dist/rules/suppressions/no-inline.d.ts.map +0 -1
- package/dist/rules/suppressions/no-inline.js.map +0 -1
- package/dist/rules/suppressions/stylesheet-comments.d.ts.map +0 -1
- package/dist/rules/suppressions/stylesheet-comments.js.map +0 -1
- package/dist/standard-schema.d.ts.map +0 -1
- package/dist/standard-schema.js.map +0 -1
- package/docs/modules.md +0 -274
- package/docs/naming.md +0 -130
- package/docs/roadmap.md +0 -37
- package/docs/rules.md +0 -297
- package/docs/tooling.md +0 -105
- /package/src/cli/{run-main.ts → runMain.ts} +0 -0
- /package/src/engine/{baseline-file.ts → baselineFile.ts} +0 -0
- /package/src/imports/{pnpm-workspace.ts → pnpmWorkspacePatterns.ts} +0 -0
- /package/src/inventory/{ignore-scope.ts → ignoreScope.ts} +0 -0
- /package/src/rules/comments/{pattern-rule.ts → definePattern.ts} +0 -0
- /package/src/rules/comments/{max-per-file.ts → maxPerFile.ts} +0 -0
- /package/src/rules/comments/{no-jsdoc.ts → noJsdoc.ts} +0 -0
- /package/src/rules/{manifests-sorted.ts → manifestsSorted.ts} +0 -0
- /package/src/rules/{max-lines.ts → maxLines.ts} +0 -0
- /package/src/rules/suppressions/{biome-overrides.ts → biomeOverrides.ts} +0 -0
- /package/src/rules/suppressions/{no-double-cast.ts → noDoubleCast.ts} +0 -0
- /package/src/rules/suppressions/{stylesheet-comments.ts → stylesheetComments.ts} +0 -0
- /package/src/{standard-schema.ts → standardSchema.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { definePatternRule } from "./
|
|
1
|
+
import { definePatternRule } from "./definePattern.js";
|
|
2
2
|
const SOURCE_EXTENSION = "(?:[cm]?[jt]sx?|json5?|mdx?|css|scss|less|html?|vue|svelte|astro|ya?ml|toml|sql|prisma|graphql|gql|go|rs|py|rb|java|kt|swift|sh)";
|
|
3
3
|
export const noLineReference = definePatternRule({
|
|
4
4
|
description: "A line number goes stale with the next edit. Name the function, type, test or setting instead.",
|
|
@@ -6,4 +6,4 @@ export const noLineReference = definePatternRule({
|
|
|
6
6
|
message: (match) => `Refers to a line: "${match}".`,
|
|
7
7
|
patterns: [new RegExp(`[\\w./@-]*\\.${SOURCE_EXTENSION}(?::\\d+|#L\\d+)`, "iu"), /(?<![\w-])lines?\s+\d+/iu],
|
|
8
8
|
});
|
|
9
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=noLineReference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noLineReference.js","sourceRoot":"","sources":["../../../src/rules/comments/noLineReference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,gBAAgB,GACrB,kIAAkI,CAAC;AAEpI,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAC;IAChD,WAAW,EAAE,gGAAgG;IAC7G,EAAE,EAAE,4BAA4B;IAChC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,sBAAsB,KAAK,IAAI;IACnD,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,gBAAgB,gBAAgB,kBAAkB,EAAE,IAAI,CAAC,EAAE,0BAA0B,CAAC;CAC5G,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const noPrReference: import("../../rule.ts").Rule<"comments/no-pr-reference", undefined>;
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=noPrReference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noPrReference.d.ts","sourceRoot":"","sources":["../../../src/rules/comments/noPrReference.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,qEAUxB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { definePatternRule } from "./
|
|
1
|
+
import { definePatternRule } from "./definePattern.js";
|
|
2
2
|
export const noPrReference = definePatternRule({
|
|
3
3
|
description: "History belongs in version control, not in the code. State the reason itself, so the comment holds without the link.",
|
|
4
4
|
id: "comments/no-pr-reference",
|
|
@@ -10,4 +10,4 @@ export const noPrReference = definePatternRule({
|
|
|
10
10
|
/(?<![\w&/#-])#\d+\b/u,
|
|
11
11
|
],
|
|
12
12
|
});
|
|
13
|
-
//# sourceMappingURL=
|
|
13
|
+
//# sourceMappingURL=noPrReference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noPrReference.js","sourceRoot":"","sources":["../../../src/rules/comments/noPrReference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,CAAC,MAAM,aAAa,GAAG,iBAAiB,CAAC;IAC9C,WAAW,EAAE,sHAAsH;IACnI,EAAE,EAAE,0BAA0B;IAC9B,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,uCAAuC,KAAK,IAAI;IACpE,QAAQ,EAAE;QACT,mEAAmE;QACnE,8CAA8C;QAC9C,aAAa;QACb,sBAAsB;KACtB;CACD,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const noTodo: import("../../rule.ts").Rule<"comments/no-todo", undefined>;
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=noTodo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noTodo.d.ts","sourceRoot":"","sources":["../../../src/rules/comments/noTodo.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,6DAKjB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { definePatternRule } from "./
|
|
1
|
+
import { definePatternRule } from "./definePattern.js";
|
|
2
2
|
export const noTodo = definePatternRule({
|
|
3
3
|
description: "A TODO in the code is never done. Do the work now, or track it where the repository tracks work.",
|
|
4
4
|
id: "comments/no-todo",
|
|
5
5
|
message: (match) => `Marks unfinished work: "${match}".`,
|
|
6
6
|
patterns: [/\b(?:TODO|FIXME|XXX)\b/u, /@todo\b/iu],
|
|
7
7
|
});
|
|
8
|
-
//# sourceMappingURL=
|
|
8
|
+
//# sourceMappingURL=noTodo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noTodo.js","sourceRoot":"","sources":["../../../src/rules/comments/noTodo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,CAAC,MAAM,MAAM,GAAG,iBAAiB,CAAC;IACvC,WAAW,EAAE,kGAAkG;IAC/G,EAAE,EAAE,kBAAkB;IACtB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,2BAA2B,KAAK,IAAI;IACxD,QAAQ,EAAE,CAAC,yBAAyB,EAAE,WAAW,CAAC;CAClD,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const manifestsSorted: import("#rule.ts").Rule<"manifests/sorted", undefined>;
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=manifestsSorted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifestsSorted.d.ts","sourceRoot":"","sources":["../../src/rules/manifestsSorted.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,eAAe,wDAY1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifestsSorted.js","sourceRoot":"","sources":["../../src/rules/manifestsSorted.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAgB,MAAM,UAAU,CAAC;AAEpD,MAAM,QAAQ,GAAG;IAChB,OAAO,EAAE,oBAAoB;IAC7B,QAAQ,EAAE,6DAA6D;CAC9D,CAAC;AAEX,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;IACzC,KAAK,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE;QACnC,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACxG,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/G,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAsB,EAAE;YAC3D,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAChC,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC3F,CAAC,CAAC,CAAC;IACJ,CAAC;IACD,WAAW,EAAE,2GAA2G;IACxH,EAAE,EAAE,kBAAkB;IACtB,WAAW,EAAE,KAAK;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifestsSourceFirst.d.ts","sourceRoot":"","sources":["../../src/rules/manifestsSourceFirst.ts"],"names":[],"mappings":"AAqCA,eAAO,MAAM,oBAAoB,8DAU/B,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as NodeFileSystem from "@effect/platform-node/NodeFileSystem";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { manifestsIn } from "#manifests/sorted.ts";
|
|
4
|
+
import { defineRule } from "#rule.ts";
|
|
5
|
+
import { entriesOf, itemsOf, member, parseJsonc } from "#rules/suppressions/biome/json.ts";
|
|
6
|
+
const CONDITION = "source";
|
|
7
|
+
function misplaced(path, field, node) {
|
|
8
|
+
const conditions = entriesOf(node);
|
|
9
|
+
const first = conditions[0]?.[0];
|
|
10
|
+
const own = first === CONDITION || !conditions.some(([key]) => key === CONDITION)
|
|
11
|
+
? []
|
|
12
|
+
: [
|
|
13
|
+
{
|
|
14
|
+
file: path,
|
|
15
|
+
line: node.line,
|
|
16
|
+
message: `Lists the "${CONDITION}" condition after "${first}" in ${field}. TypeScript takes the first condition that matches, so once built output exists it reads that instead of the sources the "${CONDITION}" condition names. Move "${CONDITION}" to the top of this condition block.`,
|
|
17
|
+
subject: field,
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
const nested = [...conditions.map(([, value]) => value), ...itemsOf(node)];
|
|
21
|
+
return [...own, ...nested.flatMap((value) => misplaced(path, field, value))];
|
|
22
|
+
}
|
|
23
|
+
function findingsIn(path, text) {
|
|
24
|
+
const parsed = parseJsonc(path, text);
|
|
25
|
+
if (parsed._tag !== "Parsed") {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
return ["exports", "imports"].flatMap((field) => {
|
|
29
|
+
const map = member(parsed.json, field);
|
|
30
|
+
return map === undefined ? [] : misplaced(path, field, map);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export const manifestsSourceFirst = defineRule({
|
|
34
|
+
check: async ({ readText, root }) => {
|
|
35
|
+
const manifests = await Effect.runPromise(manifestsIn(root).pipe(Effect.provide(NodeFileSystem.layer)));
|
|
36
|
+
const texts = await Promise.all(manifests.map(async (path) => ({ path, text: (await readText(path)) ?? "" })));
|
|
37
|
+
return texts.filter(({ text }) => text.includes(`"${CONDITION}"`)).flatMap(({ path, text }) => findingsIn(path, text));
|
|
38
|
+
},
|
|
39
|
+
description: 'Every package.json condition block that names the "source" condition lists it first in exports and imports, so TypeScript reads the sources whether or not built output exists.',
|
|
40
|
+
id: "manifests/source-first",
|
|
41
|
+
registrable: false,
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=manifestsSourceFirst.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifestsSourceFirst.js","sourceRoot":"","sources":["../../src/rules/manifestsSourceFirst.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAgB,MAAM,UAAU,CAAC;AACp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0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maxLines.d.ts","sourceRoot":"","sources":["../../src/rules/maxLines.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,QAAQ;;;EAMnB,CAAC"}
|
|
@@ -25,4 +25,4 @@ export const maxLines = defineRule({
|
|
|
25
25
|
id: "structure/max-lines",
|
|
26
26
|
options: Schema.toStandardSchemaV1(MaxLinesOptions, { parseOptions: { errors: "all", onExcessProperty: "error" } }),
|
|
27
27
|
});
|
|
28
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=maxLines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maxLines.js","sourceRoot":"","sources":["../../src/rules/maxLines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAiC,MAAM,UAAU,CAAC;AAErE,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAExD,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IACrC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7G,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;CAC3G,CAAC,CAAC;AAEH,SAAS,SAAS,CAAC,IAAgB,EAAE,KAAa;IACjD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,KAAK;QAChC,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC;YACA;gBACC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK;gBAChC,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,sBAAsB,KAAK,cAAc;gBACtE,SAAS,EAAE,KAAK;aAChB;SACD,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;IAClC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAC/B,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACjJ,WAAW,EAAE,2GAA2G;IACxH,EAAE,EAAE,qBAAqB;IACzB,OAAO,EAAE,MAAM,CAAC,kBAAkB,CAAC,eAAe,EAAE,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,EAAE,CAAC;CACnH,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"biomeOverrides.d.ts","sourceRoot":"","sources":["../../../src/rules/suppressions/biomeOverrides.ts"],"names":[],"mappings":"AAkEA,eAAO,MAAM,cAAc;;;;;;EAqBzB,CAAC"}
|
|
@@ -72,4 +72,4 @@ export const biomeOverrides = defineRule({
|
|
|
72
72
|
options: Schema.toStandardSchemaV1(BiomeOverridesOptions, { parseOptions: { errors: "all", onExcessProperty: "error" } }),
|
|
73
73
|
registrable: false,
|
|
74
74
|
});
|
|
75
|
-
//# sourceMappingURL=
|
|
75
|
+
//# sourceMappingURL=biomeOverrides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"biomeOverrides.js","sourceRoot":"","sources":["../../../src/rules/suppressions/biomeOverrides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,UAAU,EAAgB,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AACvF,OAAO,EAAE,YAAY,EAAc,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,OAAO,EAAe,MAAM,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAC;AACpG,OAAO,EAAkB,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAEvF,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;CACnG,CAAC,CAAC;AAMH,SAAS,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,EAAS;IACzC,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CACpC,MAAM,KAAK,SAAS;QACnB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAA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,EAAE,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;QACzF,CAAC;QACD,OAAO;YACN,GAAG,QAAQ;YACX,GAAG,CAAC,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;YACpC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,CAAC,UAAU,IAAI,mBAAmB,CAAC,CAAC;YAC5I,GAAG,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;SAC/D,CAAC;IACH,CAAC;IACD,WAAW,EACV,sKAAsK;IACvK,EAAE,EAAE,8BAA8B;IAClC,OAAO,EAAE,MAAM,CAAC,kBAAkB,CAAC,qBAAqB,EAAE,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,EAAE,CAAC;IACzH,WAAW,EAAE,KAAK;CAClB,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const noDoubleCast: import("#rule.ts").Rule<"suppressions/no-double-cast", undefined>;
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=noDoubleCast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noDoubleCast.d.ts","sourceRoot":"","sources":["../../../src/rules/suppressions/noDoubleCast.ts"],"names":[],"mappings":"AA4CA,eAAO,MAAM,YAAY,mEAMvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noDoubleCast.js","sourceRoot":"","sources":["../../../src/rules/suppressions/noDoubleCast.ts"],"names":[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CAAC;YAC1B,MAAM,IAAI,GAAG,MAAM,CAAC,6BAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;YAClF,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,MAAM,4CAA4C,EAAE,CAAC,CAAC;QACpH,CAAC;QACD,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC9B,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,CAAC;IACd,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED,SAAS,WAAW,CAAC,IAAgB;IACpC,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;IACtC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;IACpD,WAAW,EACV,qKAAqK;IACtK,EAAE,EAAE,6BAA6B;IACjC,WAAW,EAAE,KAAK;CAClB,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { relative } from "node:path";
|
|
2
2
|
import * as NodeFileSystem from "@effect/platform-node/NodeFileSystem";
|
|
3
3
|
import { Effect } from "effect";
|
|
4
|
-
import { posix } from "#inventory/
|
|
4
|
+
import { posix } from "#inventory/ignoreScope.ts";
|
|
5
5
|
import { walk } from "#inventory/walk.ts";
|
|
6
6
|
import { defineRule } from "#rule.ts";
|
|
7
7
|
import { member, parseJsonc } from "#rules/suppressions/biome/json.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noIgnoreDeprecations.js","sourceRoot":"","sources":["../../../src/rules/suppressions/noIgnoreDeprecations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,cAAc,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"noIgnoreDeprecations.js","sourceRoot":"","sources":["../../../src/rules/suppressions/noIgnoreDeprecations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,cAAc,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAgB,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAEvE,MAAM,MAAM,GAAG,oBAAoB,CAAC;AAEpC,MAAM,OAAO,GAAG,SAAS,MAAM,qHAAqH,CAAC;AAErJ,SAAS,SAAS,CAAC,IAAY,EAAE,IAAY;IAC5C,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9G,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EA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|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const noInline: import("#rule.ts").Rule<"suppressions/no-inline", undefined>;
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=noInline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noInline.d.ts","sourceRoot":"","sources":["../../../src/rules/suppressions/noInline.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,QAAQ,8DASnB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineRule } from "#rule.ts";
|
|
2
2
|
import { scanComments } from "#rules/comments/scan.ts";
|
|
3
3
|
import { suppressionIn } from "./directives.js";
|
|
4
|
-
import { STYLESHEET, stylesheetComments } from "./
|
|
4
|
+
import { STYLESHEET, stylesheetComments } from "./stylesheetComments.js";
|
|
5
5
|
const TYPE_TEST = /(?:(?:^|\/)typecheck\.test|\.typecheck\.(?:test|spec))\.[cm]?[jt]sx?$/u;
|
|
6
6
|
const TYPE_TEST_DIRECTIVE = "@ts-expect-error";
|
|
7
7
|
function sitesIn(file, comments) {
|
|
@@ -24,4 +24,4 @@ export const noInline = defineRule({
|
|
|
24
24
|
id: "suppressions/no-inline",
|
|
25
25
|
registrable: false,
|
|
26
26
|
});
|
|
27
|
-
//# sourceMappingURL=
|
|
27
|
+
//# sourceMappingURL=noInline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noInline.js","sourceRoot":"","sources":["../../../src/rules/suppressions/noInline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiC,MAAM,UAAU,CAAC;AACrE,OAAO,EAAsB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAEzE,MAAM,SAAS,GAAG,wEAAwE,CAAC;AAE3F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AAI,CAAC,IAAI,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;IAClC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CACvB,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CACvH,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CACxB;IACF,WAAW,EACV,0PAA0P;IAC3P,EAAE,EAAE,wBAAwB;IAC5B,WAAW,EAAE,KAAK;CAClB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type SourceComment } from "#rules/comments/scan.ts";
|
|
2
2
|
export declare const STYLESHEET: RegExp;
|
|
3
3
|
export declare function stylesheetComments(path: string, text: string): readonly SourceComment[];
|
|
4
|
-
//# sourceMappingURL=
|
|
4
|
+
//# sourceMappingURL=stylesheetComments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stylesheetComments.d.ts","sourceRoot":"","sources":["../../../src/rules/suppressions/stylesheetComments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAErE,eAAO,MAAM,UAAU,QAA0B,CAAC;AA2BlD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,aAAa,EAAE,CAEvF"}
|
|
@@ -23,4 +23,4 @@ function toComment(text, token, offset) {
|
|
|
23
23
|
export function stylesheetComments(path, text) {
|
|
24
24
|
return [...text.matchAll(tokensOf(path))].flatMap((match) => (match[0].startsWith("/") ? [toComment(text, match[0], match.index)] : []));
|
|
25
25
|
}
|
|
26
|
-
//# sourceMappingURL=
|
|
26
|
+
//# sourceMappingURL=stylesheetComments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stylesheetComments.js","sourceRoot":"","sources":["../../../src/rules/suppressions/stylesheetComments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAsB,MAAM,yBAAyB,CAAC;AAErE,MAAM,CAAC,MAAM,UAAU,GAAG,uBAAuB,CAAC;AAElD,MAAM,aAAa,GAAG,mBAAmB,CAAC;AAE1C,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAA,gFAAgF,CAAC;AAE1G,SAAS,QAAQ,CAAC,IAAY;IAC7B,OAAO,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,gBAAgB,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,MAAM,CAAC,IAAY,EAAE,MAAc;IAC3C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;AACjD,CAAC;AAED,SAAS,SAAS,CAAC,IAAY,EAAE,KAAa,EAAE,MAAc;IAC7D,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IACvD,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACzD,OAAO;QACN,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;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,CAAC,MAAM,EAAE,OAAO,CAAA;SAAE,GAAG,SAAS,CAAC;KAClF,CAAC;CACF;AAED,MAAM,MAAM,cAAc,CAAC,OAAO,IAAI;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAA;CAAE,CAAC;AAE/I,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,WAAW,GAAG;QAAE,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAA;KAAE,CAAC,GAAG,SAAS,CAAC;CACvF;AAWD,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAE1D"}
|
|
@@ -8,4 +8,4 @@ function segment(part) {
|
|
|
8
8
|
export function describeIssue(issue) {
|
|
9
9
|
return issue.path === undefined || issue.path.length === 0 ? issue.message : `${issue.path.map(segment).join(".")}: ${issue.message}`;
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=
|
|
11
|
+
//# sourceMappingURL=standardSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standardSchema.js","sourceRoot":"","sources":["../src/standardSchema.ts"],"names":[],"mappings":"AAkBA,2HAA2H;AAC3H,SAAS,OAAO,CAAC,GAAgB;IAChC,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AACvB,CAAC;AAED,SAAS,OAAO,CAAC,IAAiD;IACjE,OAAO,OAAO,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAoB;IACjD,OAAO,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;AACvI,CAAC"}
|
package/dist/testProjects.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testProjects.d.ts","sourceRoot":"","sources":["../src/testProjects.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"testProjects.d.ts","sourceRoot":"","sources":["../src/testProjects.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAepE,wBAAgB,YAAY,IAAI,cAAc,CAa7C"}
|
package/dist/testProjects.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Config, ConfigProvider, Effect } from "effect";
|
|
1
2
|
import { defaultExclude } from "vitest/config";
|
|
2
3
|
const EXTENSION = "?(c|m)[jt]s?(x)";
|
|
3
4
|
const TYPECHECK_ALONE = `**/typecheck.test.${EXTENSION}`;
|
|
@@ -7,10 +8,8 @@ function named(environment) {
|
|
|
7
8
|
function excluding(...patterns) {
|
|
8
9
|
return [...defaultExclude, named("typecheck"), TYPECHECK_ALONE, ...patterns];
|
|
9
10
|
}
|
|
10
|
-
export function testProjects(
|
|
11
|
-
|
|
12
|
-
throw new Error("testProjects takes no options. Remove suite exclusions; every test belongs in its named project.");
|
|
13
|
-
}
|
|
11
|
+
export function testProjects() {
|
|
12
|
+
const ci = Effect.runSync(Config.String("CI").pipe(Config.withDefault("")).parse(ConfigProvider.fromEnv()));
|
|
14
13
|
return {
|
|
15
14
|
project: ["unit", "dom"],
|
|
16
15
|
projects: [
|
|
@@ -18,6 +17,7 @@ export function testProjects(...options) {
|
|
|
18
17
|
{ extends: true, test: { environment: "happy-dom", exclude: excluding(named("slow")), include: [named("dom")], name: "dom" } },
|
|
19
18
|
{ extends: true, test: { environment: "node", exclude: excluding(), include: [named("slow")], name: "slow" } },
|
|
20
19
|
],
|
|
20
|
+
silent: ci ? false : "passed-only",
|
|
21
21
|
// Tests that start real servers, browsers or CLIs need seconds on a busy CI runner, and Vitest's 5s default fails them for load, not behavior.
|
|
22
22
|
testTimeout: 30_000,
|
|
23
23
|
};
|
package/dist/testProjects.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testProjects.js","sourceRoot":"","sources":["../src/testProjects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAuB,MAAM,eAAe,CAAC;AAGpE,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAEpC,MAAM,eAAe,GAAG,qBAAqB,SAAS,EAAE,CAAC;AAEzD,SAAS,KAAK,CAAC,WAAyB;IACvC,OAAO,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,qBAAqB,SAAS,EAAE,CAAC,CAAC,CAAC,QAAQ,WAAW,iBAAiB,SAAS,EAAE,CAAC;AACvH,CAAC;AAED,SAAS,SAAS,CAAC,GAAG,QAA2B;IAChD,OAAO,CAAC,GAAG,cAAc,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,YAAY,
|
|
1
|
+
{"version":3,"file":"testProjects.js","sourceRoot":"","sources":["../src/testProjects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,EAAE,cAAc,EAAuB,MAAM,eAAe,CAAC;AAGpE,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAEpC,MAAM,eAAe,GAAG,qBAAqB,SAAS,EAAE,CAAC;AAEzD,SAAS,KAAK,CAAC,WAAyB;IACvC,OAAO,WAAW,KAAK,SAAS,CA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D,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa;QAClC,+IAA+I;QAC/I,WAAW,EAAE,MAAM;KACnB,CAAC;AACH,CAAC"}
|
package/docs/debt-and-hooks.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Existing debt, exceptions and commit checks
|
|
2
2
|
|
|
3
|
-
The [README](../README.md) introduces the gate.
|
|
3
|
+
The [README](../README.md) introduces the gate. This page explains how the baseline records debt, how exceptions are applied and how the pre-commit hook runs.
|
|
4
4
|
|
|
5
5
|
## Baseline
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ The [README](../README.md) introduces the gate. Adopt the whole policy with its
|
|
|
11
11
|
|
|
12
12
|
The baseline is a JSON Lines file with one entry per line: the violations of one rule in one file. `count` is how many violations the file may have. For a rule that counts occurrences, such as `comments/no-jsdoc`, that is the number of occurrences. For a rule with a limit, it is the amount over the limit: the entry above lets `src/server/db.ts` have 412 lines under a limit of 150. A new baseline is sorted by path and then rule. Later edits preserve unrelated lines, including their formatting and order, so the diff shows the entries that changed.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
`quality lint` fails when a baselined file has more violations than its `count`; the report then lists all of that file's violations for the rule. A file at or below its entry passes. An entry that allows more than is left, including a file with no violations left, is listed as a note and does not fail, so fixing debt never breaks the build; `tighten` and `prune` lower it. An entry for an unknown rule fails until it is pruned.
|
|
15
15
|
|
|
16
16
|
- `quality baseline write` records every error-level violation when there is no baseline yet. Once a baseline exists it refuses, unless `--rule <id>` names the rules to record: it then replaces the entries of those rules with what the files have now, and leaves every other entry as it is.
|
|
17
17
|
- `quality baseline tighten` lowers and removes the entries of files changed since `HEAD`, and with `--staged`, of the files staged for the next commit. It carries the entry of a file that git sees as moved to the new path. Every other line stays byte for byte.
|
|
@@ -35,33 +35,19 @@ quality lint
|
|
|
35
35
|
|
|
36
36
|
An error-level finding that neither the config exceptions nor the baseline covers fails `quality lint`; that is how new debt gets noticed. The baseline itself may grow: a reviewer sees each new or raised entry in the diff and judges it. When the failing findings are debt the baseline should keep, such as the debt of a file that moved or was renamed, record the rule again with `quality baseline write --rule <id>`. The report ends with that command for the rules that failed. Then call out the baseline growth in the pull request description.
|
|
37
37
|
|
|
38
|
-
When an upgrade adds a shared check, keep its default error level, inspect its findings and record retained debt with `quality baseline write --rule <id>`. Review any new counts in the commit.
|
|
39
|
-
|
|
40
38
|
### Counts after a policy change
|
|
41
39
|
|
|
42
|
-
A count depends on the rule's limit, so a Quality policy change that adjusts a limit shifts every count of that rule.
|
|
40
|
+
A count depends on the rule's limit, so a Quality policy change that adjusts a limit shifts every count of that rule. A looser limit leaves entries that allow more than is left: they pass, and `tighten` and `prune` lower them. A stricter limit can make an error-level rule's files fail `quality lint`, since each is now further over the limit. Inspect the findings under the new policy before recording retained debt again with `quality baseline write --rule <id>`. Commit the counts with the policy upgrade. The raised entries show in the diff, and the pull request calls them out.
|
|
43
41
|
|
|
44
42
|
## Exceptions
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
```ts
|
|
49
|
-
export default defineConfig({
|
|
50
|
-
exceptions: [
|
|
51
|
-
{
|
|
52
|
-
files: ["src/parse.ts"],
|
|
53
|
-
reason: "This parser documents and returns the external format unchanged.",
|
|
54
|
-
rules: ["comments/no-jsdoc", "biome/lint/suspicious/noExplicitAny"],
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
});
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Paths are explicit, relative to the config folder. A Quality exception can add `subject` to cover only that finding's subject. Rules that refuse exceptions still refuse them. Quality exceptions apply before the baseline and must cover a current finding; unknown rules, refused rules and stale entries fail the gate. Biome declarations permit individual lint rules and assist actions on explicit files, without a subject. A Biome declaration naming a missing file fails too.
|
|
44
|
+
Permanent exceptions live in `quality.config.ts`'s `exceptions`, as the [README](../README.md#configuration-limits) shows. One entry names `files`, `rules` and one `reason`; it can cover both Quality and Biome rules on the same file. Paths are explicit, relative to the config folder. A Quality exception can add `subject` to cover only that finding's subject. Rules that refuse exceptions still refuse them. Quality exceptions apply before the baseline and must cover a current finding; unknown rules, refused rules and stale entries fail the gate. Biome declarations permit individual lint rules and assist actions on explicit files, without a subject. A Biome declaration naming a missing file fails too.
|
|
61
45
|
|
|
62
46
|
Quality merges the native Biome overrides into a temporary config beside the root config, preserving the repository's settings, preset and plugins, and removes the temporary file after the command. Both `quality lint` and `quality fix` use it. Keep `biome.json` free of consumer exception settings; a manual weakening is still reported. Direct editor or Biome commands use the checked-in config; run Quality to apply its exceptions.
|
|
63
47
|
|
|
64
|
-
For a generated directory exclusion, use `rules: ["biome/files/includes"]` and `files: ["**", "!**/test-support/generated"]`.
|
|
48
|
+
For a generated directory exclusion, use `rules: ["biome/files/includes"]` and `files: ["**", "!**/test-support/generated"]`. Each negative pattern names a concrete directory: it may start with `**/` and use `*` for an intermediate directory, as in `!**/test-support/*/generated`; file patterns, nested `**` and wildcard suffixes are rejected.
|
|
49
|
+
|
|
50
|
+
A package that ships its own Biome preset declares the weakenings the preset makes in a `declarations.json` beside the preset file, as an array of `{ rule, includes, reason }` entries, so a repository that extends it adds nothing for them. Quality's own preset ships its reasons this way.
|
|
65
51
|
|
|
66
52
|
### Upgrade existing exceptions
|
|
67
53
|
|
|
@@ -77,24 +63,9 @@ Export an object or `defineConfig({ ... })` without spreads for automatic editin
|
|
|
77
63
|
|
|
78
64
|
## Pre-commit hook
|
|
79
65
|
|
|
80
|
-
|
|
81
|
-
quality hooks install
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
`quality hooks install` installs a git pre-commit hook that runs `quality hooks pre-commit` before every commit. Installing dependencies never installs it: a repository opts in by running the command, usually from the setup script each checkout runs once. Running it again is safe.
|
|
85
|
-
|
|
86
|
-
The hook runs `quality lint`, then the `typecheck` script from `package.json` when present, then an optional `quality:commit` script for repository checks:
|
|
87
|
-
|
|
88
|
-
```json
|
|
89
|
-
{
|
|
90
|
-
"scripts": {
|
|
91
|
-
"quality:commit": "pnpm test",
|
|
92
|
-
"typecheck": "tsc --noEmit"
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
```
|
|
66
|
+
`quality hooks install` installs a git pre-commit hook that runs `quality hooks pre-commit` before every commit: `quality lint`, then the `typecheck` script, then an optional `quality:commit` script, as the [README](../README.md) describes. A repository opts in by running the command, usually from the setup script each checkout runs once. Running it again is safe.
|
|
96
67
|
|
|
97
|
-
Scripts run from the config's folder, or the current directory when there is no config.
|
|
68
|
+
Scripts run from the config's folder, or the current directory when there is no config. Without a manifest or either script, the hook runs lint alone. An invalid manifest stops the run. Baseline tightening is an explicit command; the hook does not change or stage debt records.
|
|
98
69
|
|
|
99
70
|
After a reported lint failure or a nonzero command exit, later commands still run, so one attempt shows their results too. A config, setup or process-launch failure stops the run. `lint` and the commands check the files on disk, not only what is staged. When checks report failures, the hook blocks the commit and ends with the checks that failed and what to do next:
|
|
100
71
|
|
package/docs/north-star.md
CHANGED
|
@@ -18,7 +18,6 @@ Every finding should tell an agent that has never used the package what to chang
|
|
|
18
18
|
|
|
19
19
|
## What good looks like
|
|
20
20
|
|
|
21
|
-
- Adoption is a small setup task. A repository uses the shared defaults instead of maintaining its own catalogue of rules and levels.
|
|
22
21
|
- Quality's rules, tool configuration and internal exceptions express one policy. A new shared convention belongs here, with a reason and accepted and rejected examples.
|
|
23
22
|
- Repository-specific inputs describe code and architecture. A generated path or import fence does not become permission to choose a weaker standard.
|
|
24
23
|
- The config, inventory, rule evaluation, exceptions, baseline and report form one path. Checks use that path instead of inventing their own debt handling.
|
|
@@ -32,8 +31,6 @@ Every finding should tell an agent that has never used the package what to chang
|
|
|
32
31
|
|
|
33
32
|
A new setting creates a decision every consuming repository must make and maintain. Prefer improving the shared default. Add an input when the check needs a fact about the repository, not merely because another repository prefers a different rule or threshold. Quality can disable a tool rule internally when another tool owns the check or the rule cannot make a reliable judgement. That reason belongs with the shared configuration.
|
|
34
33
|
|
|
35
|
-
The public configuration surface and its gaps are recorded in the [roadmap](./roadmap.md). Usage documentation must describe what the code actually accepts without turning an implementation gap into recommended policy.
|
|
36
|
-
|
|
37
34
|
### Strictness and adoption
|
|
38
35
|
|
|
39
36
|
Adopt the policy as a whole; record old debt instead of weakening it. The baseline exposes uncovered findings without demanding an immediate clean-up of every file. It is a record to review, not proof that retained debt is harmless. Explicit recording can raise counts, and a reviewer owns whether that growth is justified. A config exception is for an enduring, explained exception a rule permits, not a substitute for following that rule.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shivaedev/quality",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "Repository quality gate with typed rules, a baseline of existing debt and a registry of reasoned exceptions",
|
|
5
5
|
"homepage": "https://github.com/ShivaeDev/platform/tree/main/packages/quality#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -24,9 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"exports": {
|
|
26
26
|
"./*.ts": {
|
|
27
|
-
"types": "./dist/*.d.ts",
|
|
28
27
|
"source": "./src/*.ts",
|
|
29
|
-
"
|
|
28
|
+
"types": "./dist/*.d.ts",
|
|
30
29
|
"default": "./dist/*.js"
|
|
31
30
|
},
|
|
32
31
|
"./biome": "./biome/preset.json",
|
package/src/baseline/compare.ts
CHANGED
|
@@ -33,7 +33,7 @@ export function applyBaseline(violations: readonly Violation[], entries: readonl
|
|
|
33
33
|
const group = groups.get(keyOf(entry.rule, entry.file)) ?? [];
|
|
34
34
|
if (group.length === 0) {
|
|
35
35
|
const level = levelOf(rules, entry.rule);
|
|
36
|
-
(level === undefined
|
|
36
|
+
(level === undefined ? stale : loose).push({
|
|
37
37
|
entry,
|
|
38
38
|
problem: unusedEntryProblem(rules, entry.rule, "has no violations left"),
|
|
39
39
|
});
|
package/src/baseline/update.ts
CHANGED
|
@@ -29,7 +29,7 @@ function refusal(id: string, index: RuleIndex): readonly string[] {
|
|
|
29
29
|
if (level === undefined) {
|
|
30
30
|
return [`${id}: no built-in or local rule has this id.`];
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return [];
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export function adopt(
|
|
@@ -49,7 +49,7 @@ export function adopt(
|
|
|
49
49
|
return rules.some((name) => covers(name, rule));
|
|
50
50
|
}
|
|
51
51
|
const kept = (existing ?? []).filter((entry) => !named(entry.rule));
|
|
52
|
-
const adopted = violations.filter((violation) =>
|
|
52
|
+
const adopted = violations.filter((violation) => rules.length === 0 || named(violation.rule));
|
|
53
53
|
const added = record(adopted);
|
|
54
54
|
return { _tag: "Adopted", added: added.length, entries: [...kept, ...added], replaced: (existing ?? []).length - kept.length };
|
|
55
55
|
}
|
|
@@ -89,7 +89,7 @@ export function prune(
|
|
|
89
89
|
}
|
|
90
90
|
const level = levelOf(index, before.rule);
|
|
91
91
|
const now = current.get(keyOf(before.rule, before.file)) ?? destination(before, current, scope.moves, taken);
|
|
92
|
-
if (now === undefined || level === undefined
|
|
92
|
+
if (now === undefined || level === undefined) {
|
|
93
93
|
return [];
|
|
94
94
|
}
|
|
95
95
|
moved += Number(now.file !== before.file);
|