@shivaedev/quality 0.4.0 → 0.5.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 +119 -29
- package/biome/declarations.json +17 -0
- package/biome/plugins/ambient-runtime.grit +18 -0
- package/biome/plugins/effect-fn-spans.grit +7 -0
- package/biome/preset.json +602 -0
- package/dist/baseline/compare.d.ts +8 -9
- package/dist/baseline/compare.d.ts.map +1 -1
- package/dist/baseline/compare.js +4 -4
- package/dist/baseline/compare.js.map +1 -1
- package/dist/baseline/format.d.ts +4 -4
- package/dist/baseline/format.d.ts.map +1 -1
- package/dist/baseline/format.js +3 -2
- package/dist/baseline/format.js.map +1 -1
- package/dist/baseline/guard.d.ts +3 -3
- package/dist/baseline/guard.d.ts.map +1 -1
- package/dist/baseline/guard.js +6 -5
- package/dist/baseline/guard.js.map +1 -1
- package/dist/baseline/legacy.d.ts +3 -3
- package/dist/baseline/legacy.d.ts.map +1 -1
- package/dist/baseline/legacy.js.map +1 -1
- package/dist/baseline/rewrite.d.ts +1 -1
- package/dist/baseline/rewrite.d.ts.map +1 -1
- package/dist/baseline/rewrite.js.map +1 -1
- package/dist/baseline/update.d.ts +8 -9
- package/dist/baseline/update.d.ts.map +1 -1
- package/dist/baseline/update.js +10 -9
- package/dist/baseline/update.js.map +1 -1
- package/dist/biome/report.d.ts +33 -0
- package/dist/biome/report.d.ts.map +1 -0
- package/dist/biome/report.js +25 -0
- package/dist/biome/report.js.map +1 -0
- package/dist/biome/run.d.ts +7 -0
- package/dist/biome/run.d.ts.map +1 -0
- package/dist/biome/run.js +16 -0
- package/dist/biome/run.js.map +1 -0
- package/dist/cli/args.d.ts +6 -3
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +9 -4
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/baseline.d.ts +1 -1
- package/dist/cli/baseline.d.ts.map +1 -1
- package/dist/cli/baseline.js +3 -3
- package/dist/cli/baseline.js.map +1 -1
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/fix.d.ts +4 -0
- package/dist/cli/fix.d.ts.map +1 -0
- package/dist/cli/fix.js +19 -0
- package/dist/cli/fix.js.map +1 -0
- package/dist/cli/lint.js +1 -1
- package/dist/cli/lint.js.map +1 -1
- package/dist/cli/run-main.d.ts.map +1 -1
- package/dist/cli/run-main.js +7 -3
- package/dist/cli/run-main.js.map +1 -1
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/config/decode.d.ts +4 -4
- package/dist/config/decode.js +12 -12
- package/dist/config/decode.js.map +1 -1
- package/dist/config/load.d.ts +3 -3
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +1 -1
- package/dist/config/load.js.map +1 -1
- package/dist/config/resolve.d.ts +3 -5
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +11 -5
- package/dist/config/resolve.js.map +1 -1
- package/dist/config.d.ts +9 -9
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/decoded.d.ts +1 -1
- package/dist/decoded.d.ts.map +1 -1
- package/dist/engine/baseline-file.d.ts +1 -1
- package/dist/engine/baseline-file.d.ts.map +1 -1
- package/dist/engine/evaluate.d.ts +8 -9
- package/dist/engine/evaluate.d.ts.map +1 -1
- package/dist/engine/evaluate.js +4 -4
- package/dist/engine/evaluate.js.map +1 -1
- package/dist/engine/run-rules.d.ts +4 -3
- package/dist/engine/run-rules.d.ts.map +1 -1
- package/dist/engine/run-rules.js +3 -3
- package/dist/engine/run-rules.js.map +1 -1
- package/dist/engine/session.d.ts +3 -3
- package/dist/engine/session.d.ts.map +1 -1
- package/dist/engine/violation.d.ts +11 -3
- package/dist/engine/violation.d.ts.map +1 -1
- package/dist/engine/violation.js +6 -2
- package/dist/engine/violation.js.map +1 -1
- package/dist/exceptions/registry.d.ts +7 -8
- package/dist/exceptions/registry.d.ts.map +1 -1
- package/dist/exceptions/registry.js +6 -6
- package/dist/exceptions/registry.js.map +1 -1
- package/dist/git/base.d.ts +1 -1
- package/dist/git/base.d.ts.map +1 -1
- package/dist/git/base.js.map +1 -1
- package/dist/git/command.d.ts +3 -3
- package/dist/git/command.d.ts.map +1 -1
- package/dist/git/command.js.map +1 -1
- package/dist/git/history.d.ts +1 -1
- package/dist/git/history.d.ts.map +1 -1
- package/dist/git/history.js +1 -1
- package/dist/git/history.js.map +1 -1
- package/dist/imports/ambient.d.ts +7 -0
- package/dist/imports/ambient.d.ts.map +1 -0
- package/dist/imports/ambient.js +44 -0
- package/dist/imports/ambient.js.map +1 -0
- package/dist/imports/components.d.ts +2 -0
- package/dist/imports/components.d.ts.map +1 -0
- package/dist/imports/components.js +63 -0
- package/dist/imports/components.js.map +1 -0
- package/dist/imports/extract.d.ts +10 -0
- package/dist/imports/extract.d.ts.map +1 -0
- package/dist/imports/extract.js +100 -0
- package/dist/imports/extract.js.map +1 -0
- package/dist/imports/fences/dsl.d.ts +18 -0
- package/dist/imports/fences/dsl.d.ts.map +1 -0
- package/dist/imports/fences/dsl.js +14 -0
- package/dist/imports/fences/dsl.js.map +1 -0
- package/dist/imports/fences/evaluate.d.ts +12 -0
- package/dist/imports/fences/evaluate.d.ts.map +1 -0
- package/dist/imports/fences/evaluate.js +55 -0
- package/dist/imports/fences/evaluate.js.map +1 -0
- package/dist/imports/fences/match.d.ts +17 -0
- package/dist/imports/fences/match.d.ts.map +1 -0
- package/dist/imports/fences/match.js +106 -0
- package/dist/imports/fences/match.js.map +1 -0
- package/dist/imports/fences/model.d.ts +60 -0
- package/dist/imports/fences/model.d.ts.map +1 -0
- package/dist/imports/fences/model.js +2 -0
- package/dist/imports/fences/model.js.map +1 -0
- package/dist/imports/fences/policy.d.ts +5 -0
- package/dist/imports/fences/policy.d.ts.map +1 -0
- package/dist/imports/fences/policy.js +59 -0
- package/dist/imports/fences/policy.js.map +1 -0
- package/dist/imports/fences/reach.d.ts +12 -0
- package/dist/imports/fences/reach.d.ts.map +1 -0
- package/dist/imports/fences/reach.js +39 -0
- package/dist/imports/fences/reach.js.map +1 -0
- package/dist/imports/fences/selectors.d.ts +11 -0
- package/dist/imports/fences/selectors.d.ts.map +1 -0
- package/dist/imports/fences/selectors.js +27 -0
- package/dist/imports/fences/selectors.js.map +1 -0
- package/dist/imports/fences/vocabulary.d.ts +9 -0
- package/dist/imports/fences/vocabulary.d.ts.map +1 -0
- package/dist/imports/fences/vocabulary.js +40 -0
- package/dist/imports/fences/vocabulary.js.map +1 -0
- package/dist/imports/generated.d.ts +6 -0
- package/dist/imports/generated.d.ts.map +1 -0
- package/dist/imports/generated.js +78 -0
- package/dist/imports/generated.js.map +1 -0
- package/dist/imports/glob.d.ts +2 -0
- package/dist/imports/glob.d.ts.map +1 -0
- package/dist/imports/glob.js +125 -0
- package/dist/imports/glob.js.map +1 -0
- package/dist/imports/graph.d.ts +23 -0
- package/dist/imports/graph.d.ts.map +1 -0
- package/dist/imports/graph.js +56 -0
- package/dist/imports/graph.js.map +1 -0
- package/dist/imports/paths.d.ts +2 -0
- package/dist/imports/paths.d.ts.map +1 -0
- package/dist/imports/paths.js +24 -0
- package/dist/imports/paths.js.map +1 -0
- package/dist/imports/pnpm-workspace.d.ts +2 -0
- package/dist/imports/pnpm-workspace.d.ts.map +1 -0
- package/dist/imports/pnpm-workspace.js +122 -0
- package/dist/imports/pnpm-workspace.js.map +1 -0
- package/dist/imports/projects.d.ts +10 -0
- package/dist/imports/projects.d.ts.map +1 -0
- package/dist/imports/projects.js +83 -0
- package/dist/imports/projects.js.map +1 -0
- package/dist/imports/resolve.d.ts +16 -0
- package/dist/imports/resolve.d.ts.map +1 -0
- package/dist/imports/resolve.js +88 -0
- package/dist/imports/resolve.js.map +1 -0
- package/dist/imports/workspace.d.ts +10 -0
- package/dist/imports/workspace.d.ts.map +1 -0
- package/dist/imports/workspace.js +55 -0
- package/dist/imports/workspace.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/inventory/collect.d.ts +6 -6
- package/dist/inventory/collect.d.ts.map +1 -1
- package/dist/inventory/collect.js.map +1 -1
- package/dist/manifests/sorted.d.ts +14 -0
- package/dist/manifests/sorted.d.ts.map +1 -0
- package/dist/manifests/sorted.js +39 -0
- package/dist/manifests/sorted.js.map +1 -0
- package/dist/report/guard.d.ts +1 -1
- package/dist/report/guard.d.ts.map +1 -1
- package/dist/report/guard.js +1 -1
- package/dist/report/guard.js.map +1 -1
- package/dist/report/render.d.ts +2 -2
- package/dist/report/render.d.ts.map +1 -1
- package/dist/report/render.js.map +1 -1
- package/dist/report/stale.d.ts +2 -2
- package/dist/report/stale.d.ts.map +1 -1
- package/dist/report/stale.js.map +1 -1
- package/dist/rule.d.ts +12 -11
- package/dist/rule.d.ts.map +1 -1
- package/dist/rule.js.map +1 -1
- package/dist/rules/biome.d.ts +4 -0
- package/dist/rules/biome.d.ts.map +1 -0
- package/dist/rules/biome.js +40 -0
- package/dist/rules/biome.js.map +1 -0
- package/dist/rules/built-in.d.ts +8 -10
- package/dist/rules/built-in.d.ts.map +1 -1
- package/dist/rules/built-in.js +12 -0
- package/dist/rules/built-in.js.map +1 -1
- package/dist/rules/comments/kinds.d.ts +1 -2
- package/dist/rules/comments/kinds.d.ts.map +1 -1
- package/dist/rules/comments/kinds.js +7 -16
- package/dist/rules/comments/kinds.js.map +1 -1
- package/dist/rules/comments/max-per-file.d.ts +1 -1
- package/dist/rules/comments/max-per-file.js +11 -11
- package/dist/rules/comments/max-per-file.js.map +1 -1
- package/dist/rules/comments/no-banner.js +2 -2
- package/dist/rules/comments/no-banner.js.map +1 -1
- package/dist/rules/comments/no-environment-pragma.d.ts +2 -0
- package/dist/rules/comments/no-environment-pragma.d.ts.map +1 -0
- package/dist/rules/comments/no-environment-pragma.js +8 -0
- package/dist/rules/comments/no-environment-pragma.js.map +1 -0
- package/dist/rules/comments/no-jsdoc.js +3 -3
- package/dist/rules/comments/no-jsdoc.js.map +1 -1
- package/dist/rules/comments/no-line-reference.js +2 -2
- package/dist/rules/comments/no-line-reference.js.map +1 -1
- package/dist/rules/comments/no-pr-reference.js +6 -6
- package/dist/rules/comments/no-pr-reference.js.map +1 -1
- package/dist/rules/comments/no-todo.js +2 -2
- package/dist/rules/comments/no-todo.js.map +1 -1
- package/dist/rules/comments/pattern-rule.d.ts +2 -2
- package/dist/rules/comments/pattern-rule.d.ts.map +1 -1
- package/dist/rules/comments/pattern-rule.js +2 -2
- package/dist/rules/comments/pattern-rule.js.map +1 -1
- package/dist/rules/comments/scan.d.ts +6 -6
- package/dist/rules/comments/scan.d.ts.map +1 -1
- package/dist/rules/comments/scan.js +2 -2
- package/dist/rules/comments/scan.js.map +1 -1
- package/dist/rules/imports/cycles.d.ts +2 -0
- package/dist/rules/imports/cycles.d.ts.map +1 -0
- package/dist/rules/imports/cycles.js +38 -0
- package/dist/rules/imports/cycles.js.map +1 -0
- package/dist/rules/imports/fences.d.ts +5 -0
- package/dist/rules/imports/fences.d.ts.map +1 -0
- package/dist/rules/imports/fences.js +24 -0
- package/dist/rules/imports/fences.js.map +1 -0
- package/dist/rules/imports/resolvable.d.ts +4 -0
- package/dist/rules/imports/resolvable.d.ts.map +1 -0
- package/dist/rules/imports/resolvable.js +22 -0
- package/dist/rules/imports/resolvable.js.map +1 -0
- package/dist/rules/manifests-sorted.d.ts +2 -0
- package/dist/rules/manifests-sorted.d.ts.map +1 -0
- package/dist/rules/manifests-sorted.js +22 -0
- package/dist/rules/manifests-sorted.js.map +1 -0
- package/dist/rules/max-lines.js +4 -4
- package/dist/rules/max-lines.js.map +1 -1
- package/dist/rules/suppressions/biome/configs.d.ts +6 -6
- package/dist/rules/suppressions/biome/configs.d.ts.map +1 -1
- package/dist/rules/suppressions/biome/configs.js +2 -2
- package/dist/rules/suppressions/biome/configs.js.map +1 -1
- package/dist/rules/suppressions/biome/declarations.d.ts +4 -4
- package/dist/rules/suppressions/biome/declarations.d.ts.map +1 -1
- package/dist/rules/suppressions/biome/declarations.js +3 -3
- package/dist/rules/suppressions/biome/declarations.js.map +1 -1
- package/dist/rules/suppressions/biome/json.d.ts +2 -2
- package/dist/rules/suppressions/biome/json.d.ts.map +1 -1
- package/dist/rules/suppressions/biome/json.js +1 -1
- package/dist/rules/suppressions/biome/json.js.map +1 -1
- package/dist/rules/suppressions/biome/resolve.js +3 -3
- package/dist/rules/suppressions/biome/resolve.js.map +1 -1
- package/dist/rules/suppressions/biome/weakenings.d.ts +4 -4
- package/dist/rules/suppressions/biome/weakenings.d.ts.map +1 -1
- package/dist/rules/suppressions/biome/weakenings.js.map +1 -1
- package/dist/rules/suppressions/biome-overrides.d.ts +1 -1
- package/dist/rules/suppressions/biome-overrides.js +4 -4
- package/dist/rules/suppressions/biome-overrides.js.map +1 -1
- package/dist/rules/suppressions/directives.d.ts +1 -1
- package/dist/rules/suppressions/directives.d.ts.map +1 -1
- package/dist/rules/suppressions/directives.js +11 -11
- package/dist/rules/suppressions/directives.js.map +1 -1
- package/dist/rules/suppressions/no-double-cast.js +2 -2
- package/dist/rules/suppressions/no-double-cast.js.map +1 -1
- package/dist/rules/suppressions/no-inline.d.ts +1 -7
- package/dist/rules/suppressions/no-inline.d.ts.map +1 -1
- package/dist/rules/suppressions/no-inline.js +7 -30
- package/dist/rules/suppressions/no-inline.js.map +1 -1
- package/dist/rules/suppressions/stylesheet-comments.d.ts +1 -1
- package/dist/rules/suppressions/stylesheet-comments.d.ts.map +1 -1
- package/dist/rules/suppressions/stylesheet-comments.js +3 -3
- package/dist/rules/suppressions/stylesheet-comments.js.map +1 -1
- package/dist/rules/syntax.js +4 -4
- package/dist/rules/syntax.js.map +1 -1
- package/dist/standard-schema.d.ts +1 -1
- package/dist/standard-schema.d.ts.map +1 -1
- package/dist/vitest.d.ts +3 -0
- package/dist/vitest.d.ts.map +1 -0
- package/dist/vitest.js +20 -0
- package/dist/vitest.js.map +1 -0
- package/package.json +46 -31
- package/src/baseline/compare.ts +10 -15
- package/src/baseline/format.ts +8 -6
- package/src/baseline/guard.ts +11 -10
- package/src/baseline/legacy.ts +3 -3
- package/src/baseline/rewrite.ts +1 -1
- package/src/baseline/update.ts +21 -21
- package/src/biome/report.ts +35 -0
- package/src/biome/run.ts +23 -0
- package/src/cli/args.ts +14 -8
- package/src/cli/baseline.ts +5 -6
- package/src/cli/check.ts +1 -1
- package/src/cli/fix.ts +19 -0
- package/src/cli/lint.ts +1 -1
- package/src/cli/run-main.ts +8 -3
- package/src/cli.ts +3 -0
- package/src/config/decode.ts +12 -12
- package/src/config/load.ts +4 -4
- package/src/config/resolve.ts +15 -11
- package/src/config.ts +9 -9
- package/src/decoded.ts +1 -1
- package/src/engine/baseline-file.ts +1 -1
- package/src/engine/evaluate.ts +14 -16
- package/src/engine/run-rules.ts +8 -7
- package/src/engine/session.ts +3 -3
- package/src/engine/violation.ts +18 -4
- package/src/exceptions/registry.ts +10 -16
- package/src/git/base.ts +2 -2
- package/src/git/command.ts +3 -3
- package/src/git/history.ts +2 -2
- package/src/imports/ambient.ts +54 -0
- package/src/imports/components.ts +80 -0
- package/src/imports/extract.ts +129 -0
- package/src/imports/fences/dsl.ts +33 -0
- package/src/imports/fences/evaluate.ts +75 -0
- package/src/imports/fences/match.ts +148 -0
- package/src/imports/fences/model.ts +42 -0
- package/src/imports/fences/policy.ts +70 -0
- package/src/imports/fences/reach.ts +62 -0
- package/src/imports/fences/selectors.ts +37 -0
- package/src/imports/fences/vocabulary.ts +51 -0
- package/src/imports/generated.ts +95 -0
- package/src/imports/glob.ts +142 -0
- package/src/imports/graph.ts +81 -0
- package/src/imports/paths.ts +28 -0
- package/src/imports/pnpm-workspace.ts +134 -0
- package/src/imports/projects.ts +106 -0
- package/src/imports/resolve.ts +115 -0
- package/src/imports/workspace.ts +76 -0
- package/src/index.ts +3 -0
- package/src/inventory/collect.ts +6 -6
- package/src/manifests/sorted.ts +46 -0
- package/src/report/guard.ts +2 -2
- package/src/report/render.ts +9 -9
- package/src/report/stale.ts +3 -3
- package/src/rule.ts +13 -12
- package/src/rules/biome.ts +47 -0
- package/src/rules/built-in.ts +12 -0
- package/src/rules/comments/kinds.ts +11 -21
- package/src/rules/comments/max-per-file.ts +13 -13
- package/src/rules/comments/no-banner.ts +2 -2
- package/src/rules/comments/no-environment-pragma.ts +9 -0
- package/src/rules/comments/no-jsdoc.ts +3 -3
- package/src/rules/comments/no-line-reference.ts +2 -2
- package/src/rules/comments/no-pr-reference.ts +6 -6
- package/src/rules/comments/no-todo.ts +2 -2
- package/src/rules/comments/pattern-rule.ts +6 -6
- package/src/rules/comments/scan.ts +13 -13
- package/src/rules/imports/cycles.ts +44 -0
- package/src/rules/imports/fences.ts +27 -0
- package/src/rules/imports/resolvable.ts +23 -0
- package/src/rules/manifests-sorted.ts +23 -0
- package/src/rules/max-lines.ts +6 -6
- package/src/rules/suppressions/biome/configs.ts +12 -12
- package/src/rules/suppressions/biome/declarations.ts +7 -7
- package/src/rules/suppressions/biome/json.ts +3 -3
- package/src/rules/suppressions/biome/resolve.ts +3 -3
- package/src/rules/suppressions/biome/weakenings.ts +18 -19
- package/src/rules/suppressions/biome-overrides.ts +7 -7
- package/src/rules/suppressions/directives.ts +12 -12
- package/src/rules/suppressions/no-double-cast.ts +4 -4
- package/src/rules/suppressions/no-inline.ts +13 -37
- package/src/rules/suppressions/stylesheet-comments.ts +4 -4
- package/src/rules/syntax.ts +4 -4
- package/src/standard-schema.ts +1 -1
- package/src/vitest.ts +22 -0
- package/tsconfig/base.json +21 -21
- package/tsconfig/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-inline.js","sourceRoot":"","sources":["../../../src/rules/suppressions/no-inline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"no-inline.js","sourceRoot":"","sources":["../../../src/rules/suppressions/no-inline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiC,MAAM,eAAe,CAAC;A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E,CAAC,OAAO,CAAC,IAAI,EAAE,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACnG,CAAC,CAAC;AAEF,SAAS,OAAO,CAAC,IAAU;IAC1B,OAAO,IAAI,CAAC,OAAO,KAAK,mBAAmB,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,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,wTAAwT;IACzT,EAAE,EAAE,wBAAwB;IAC5B,WAAW,EAAE,KAAK;CAClB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type SourceComment } from "../comments/scan.ts";
|
|
2
2
|
export declare const STYLESHEET: RegExp;
|
|
3
|
-
export declare const stylesheetComments: (path: string, text: string) =>
|
|
3
|
+
export declare const stylesheetComments: (path: string, text: string) => readonly SourceComment[];
|
|
4
4
|
//# sourceMappingURL=stylesheet-comments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stylesheet-comments.d.ts","sourceRoot":"","sources":["../../../src/rules/suppressions/stylesheet-comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEjE,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"stylesheet-comments.d.ts","sourceRoot":"","sources":["../../../src/rules/suppressions/stylesheet-comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEjE,eAAO,MAAM,UAAU,QAA0B,CAAC;AAuBlD,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,MAAM,MAAM,KAAG,SAAS,aAAa,EAC4C,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { bodyOf } from "../comments/scan.js";
|
|
2
|
-
export const STYLESHEET = /\.(?:css|scss|less)
|
|
3
|
-
const LINE_COMMENTS = /\.(?:scss|less)
|
|
2
|
+
export const STYLESHEET = /\.(?:css|scss|less)$/u;
|
|
3
|
+
const LINE_COMMENTS = /\.(?:scss|less)$/u;
|
|
4
4
|
const TOKENS = String.raw `"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?|url\([^)]*\)?|\/\*[\s\S]*?(?:\*\/|$)`;
|
|
5
|
-
const tokensOf = (path) => new RegExp(LINE_COMMENTS.test(path) ? `${TOKENS}|\\/\\/[^\\n]*` : TOKENS, "
|
|
5
|
+
const tokensOf = (path) => new RegExp(LINE_COMMENTS.test(path) ? `${TOKENS}|\\/\\/[^\\n]*` : TOKENS, "giu");
|
|
6
6
|
const lineOf = (text, offset) => text.slice(0, offset).split("\n").length;
|
|
7
7
|
const toComment = (text, token, offset) => {
|
|
8
8
|
const kind = token.startsWith("//") ? "line" : "block";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stylesheet-comments.js","sourceRoot":"","sources":["../../../src/rules/suppressions/stylesheet-comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAsB,MAAM,qBAAqB,CAAC;AAEjE,MAAM,CAAC,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"stylesheet-comments.js","sourceRoot":"","sources":["../../../src/rules/suppressions/stylesheet-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AI,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE;QACpD,IAAI,EAAE,KAAK;KACX,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAE,IAAY,EAA4B,EAAE,CAC1F,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
|
package/dist/rules/syntax.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
const SCRIPT_KINDS = [
|
|
3
|
-
[/\.[cm]?ts
|
|
4
|
-
[/\.tsx
|
|
5
|
-
[/\.[cm]?js
|
|
6
|
-
[/\.jsx
|
|
3
|
+
[/\.[cm]?ts$/u, ts.ScriptKind.TS],
|
|
4
|
+
[/\.tsx$/u, ts.ScriptKind.TSX],
|
|
5
|
+
[/\.[cm]?js$/u, ts.ScriptKind.JS],
|
|
6
|
+
[/\.jsx$/u, ts.ScriptKind.JSX],
|
|
7
7
|
];
|
|
8
8
|
export const parse = (file) => {
|
|
9
9
|
const kind = SCRIPT_KINDS.find(([pattern]) => pattern.test(file.path))?.[1];
|
package/dist/rules/syntax.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syntax.js","sourceRoot":"","sources":["../../src/rules/syntax.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,MAAM,YAAY,GAAoD;IACrE,CAAC,
|
|
1
|
+
{"version":3,"file":"syntax.js","sourceRoot":"","sources":["../../src/rules/syntax.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,MAAM,YAAY,GAAoD;IACrE,CAAC,aAAa,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;IACjC,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;IAC9B,CAAC,aAAa,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;IACjC,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAgB,EAA6B,EAAE;IACpE,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5E,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACvH,CAAC,CAAC"}
|
|
@@ -13,7 +13,7 @@ export type StandardResult<Output> = {
|
|
|
13
13
|
readonly value: Output;
|
|
14
14
|
readonly issues?: undefined;
|
|
15
15
|
} | {
|
|
16
|
-
readonly issues:
|
|
16
|
+
readonly issues: readonly StandardIssue[];
|
|
17
17
|
};
|
|
18
18
|
export interface StandardIssue {
|
|
19
19
|
readonly message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-schema.d.ts","sourceRoot":"","sources":["../src/standard-schema.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB,CAAC,KAAK,G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,cAAc,CAAC,MAAM,IAAI;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAA;CAAE,CAAC;AAE7I,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;AAID,eAAO,MAAM,aAAa,GAAI,OAAO,aAAa,KAAG,MAC0E,CAAC"}
|
package/dist/vitest.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.d.ts","sourceRoot":"","sources":["../src/vitest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAYpE,wBAAgB,YAAY,IAAI,cAAc,CAS7C"}
|
package/dist/vitest.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defaultExclude } from "vitest/config";
|
|
2
|
+
const TEST = "**/*.test.?(c|m)[jt]s?(x)";
|
|
3
|
+
const DOM = "**/*.dom.test.?(c|m)[jt]s?(x)";
|
|
4
|
+
const SLOW = "**/*.slow.test.?(c|m)[jt]s?(x)";
|
|
5
|
+
const TYPECHECK = "**/*.typecheck.test.?(c|m)[jt]s?(x)";
|
|
6
|
+
const TYPECHECK_ALONE = "**/typecheck.test.?(c|m)[jt]s?(x)";
|
|
7
|
+
function excluding(...patterns) {
|
|
8
|
+
return [...defaultExclude, TYPECHECK, TYPECHECK_ALONE, ...patterns];
|
|
9
|
+
}
|
|
10
|
+
export function testProjects() {
|
|
11
|
+
return {
|
|
12
|
+
project: ["unit", "dom"],
|
|
13
|
+
projects: [
|
|
14
|
+
{ extends: true, test: { environment: "node", exclude: excluding(DOM, SLOW), include: [TEST], name: "unit" } },
|
|
15
|
+
{ extends: true, test: { environment: "happy-dom", exclude: excluding(SLOW), include: [DOM], name: "dom" } },
|
|
16
|
+
{ extends: true, test: { environment: "node", exclude: excluding(), include: [SLOW], name: "slow" } },
|
|
17
|
+
],
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=vitest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.js","sourceRoot":"","sources":["../src/vitest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAuB,MAAM,eAAe,CAAC;AAEpE,MAAM,IAAI,GAAG,2BAA2B,CAAC;AACzC,MAAM,GAAG,GAAG,+BAA+B,CAAC;AAC5C,MAAM,IAAI,GAAG,gCAAgC,CAAC;AAC9C,MAAM,SAAS,GAAG,qCAAqC,CAAC;AACxD,MAAM,eAAe,GAAG,mCAAmC,CAAC;AAE5D,SAAS,SAAS,CAAC,GAAG,QAA2B;IAChD,OAAO,CAAC,GAAG,cAAc,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,YAAY;IAC3B,OAAO;QACN,OAAO,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;QACxB,QAAQ,EAAE;YACT,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;YAC9G,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;YAC5G,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;SACrG;KACD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,32 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shivaedev/quality",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Repository quality gate with typed rules, a shrink-only baseline and a registry of reasoned exceptions",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/ShivaeDev/platform.git",
|
|
10
|
-
"directory": "packages/quality"
|
|
11
|
-
},
|
|
12
5
|
"homepage": "https://github.com/ShivaeDev/platform/tree/main/packages/quality#readme",
|
|
13
6
|
"bugs": {
|
|
14
7
|
"url": "https://github.com/ShivaeDev/platform/issues"
|
|
15
8
|
},
|
|
16
|
-
"
|
|
17
|
-
"
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/ShivaeDev/platform.git",
|
|
12
|
+
"directory": "packages/quality"
|
|
18
13
|
},
|
|
14
|
+
"license": "MIT",
|
|
19
15
|
"sideEffects": false,
|
|
20
|
-
"
|
|
21
|
-
"quality": "./dist/cli.js"
|
|
22
|
-
},
|
|
23
|
-
"files": [
|
|
24
|
-
"dist",
|
|
25
|
-
"src",
|
|
26
|
-
"tsconfig",
|
|
27
|
-
"CHANGELOG.md",
|
|
28
|
-
"README.md"
|
|
29
|
-
],
|
|
16
|
+
"type": "module",
|
|
30
17
|
"exports": {
|
|
31
18
|
".": {
|
|
32
19
|
"types": "./dist/index.d.ts",
|
|
@@ -34,23 +21,34 @@
|
|
|
34
21
|
"import": "./dist/index.js",
|
|
35
22
|
"default": "./dist/index.js"
|
|
36
23
|
},
|
|
24
|
+
"./biome": "./biome/preset.json",
|
|
25
|
+
"./vitest": {
|
|
26
|
+
"types": "./dist/vitest.d.ts",
|
|
27
|
+
"source": "./src/vitest.ts",
|
|
28
|
+
"import": "./dist/vitest.js",
|
|
29
|
+
"default": "./dist/vitest.js"
|
|
30
|
+
},
|
|
37
31
|
"./tsconfig/base.json": "./tsconfig/base.json",
|
|
38
32
|
"./tsconfig/package.json": "./tsconfig/package.json",
|
|
39
33
|
"./package.json": "./package.json"
|
|
40
34
|
},
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"provenance": true
|
|
35
|
+
"bin": {
|
|
36
|
+
"quality": "./dist/cli.js"
|
|
44
37
|
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"biome",
|
|
41
|
+
"src",
|
|
42
|
+
"tsconfig",
|
|
43
|
+
"CHANGELOG.md",
|
|
44
|
+
"README.md"
|
|
45
|
+
],
|
|
45
46
|
"dependencies": {
|
|
47
|
+
"@biomejs/biome": "2.5.14",
|
|
46
48
|
"ignore": "7.0.6",
|
|
49
|
+
"sort-package-json": "4.0.0",
|
|
47
50
|
"typescript": "npm:@typescript/typescript6@6.0.2"
|
|
48
51
|
},
|
|
49
|
-
"peerDependencies": {
|
|
50
|
-
"@effect/platform-node": "4.0.0-rc.112",
|
|
51
|
-
"@effect/platform-node-shared": "4.0.0-rc.112",
|
|
52
|
-
"effect": "4.0.0-rc.112"
|
|
53
|
-
},
|
|
54
52
|
"devDependencies": {
|
|
55
53
|
"@effect/platform-node": "4.0.0-rc.112",
|
|
56
54
|
"@effect/platform-node-shared": "4.0.0-rc.112",
|
|
@@ -60,11 +58,28 @@
|
|
|
60
58
|
"effect": "4.0.0-rc.112",
|
|
61
59
|
"vitest": "4.1.9"
|
|
62
60
|
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"@effect/platform-node": "4.0.0-rc.112",
|
|
63
|
+
"@effect/platform-node-shared": "4.0.0-rc.112",
|
|
64
|
+
"effect": "4.0.0-rc.112",
|
|
65
|
+
"vitest": "4.1.9"
|
|
66
|
+
},
|
|
67
|
+
"peerDependenciesMeta": {
|
|
68
|
+
"vitest": {
|
|
69
|
+
"optional": true
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"engines": {
|
|
73
|
+
"node": ">=24"
|
|
74
|
+
},
|
|
75
|
+
"publishConfig": {
|
|
76
|
+
"access": "public",
|
|
77
|
+
"provenance": true
|
|
78
|
+
},
|
|
63
79
|
"scripts": {
|
|
64
80
|
"build": "node --eval \"import('node:fs').then(({ rmSync }) => rmSync('dist', { force: true, recursive: true }))\" && tsc6 --project tsconfig.build.json",
|
|
65
|
-
"
|
|
81
|
+
"ready": "pnpm typecheck && pnpm test && pnpm build",
|
|
66
82
|
"test": "vitest run",
|
|
67
|
-
"typecheck": "tsc --noEmit"
|
|
68
|
-
"ready": "pnpm check && pnpm typecheck && pnpm test && pnpm build"
|
|
83
|
+
"typecheck": "tsc --noEmit"
|
|
69
84
|
}
|
|
70
85
|
}
|
package/src/baseline/compare.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { groupBy, keyOf, unusedEntryProblem, type Violation } from "../engine/violation.ts";
|
|
1
|
+
import { groupBy, keyOf, levelOf, type RuleIndex, unusedEntryProblem, type Violation } from "../engine/violation.ts";
|
|
3
2
|
import type { BaselineEntry } from "./format.ts";
|
|
4
3
|
|
|
5
4
|
export interface Regression {
|
|
6
|
-
readonly entry: BaselineEntry;
|
|
7
5
|
readonly count: number;
|
|
6
|
+
readonly entry: BaselineEntry;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
export interface StaleBaselineEntry {
|
|
@@ -13,20 +12,16 @@ export interface StaleBaselineEntry {
|
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
export interface BaselineCheck {
|
|
16
|
-
readonly kept: ReadonlyArray<Violation>;
|
|
17
|
-
readonly regressions: ReadonlyArray<Regression>;
|
|
18
|
-
readonly stale: ReadonlyArray<StaleBaselineEntry>;
|
|
19
|
-
readonly loose: ReadonlyArray<StaleBaselineEntry>;
|
|
20
15
|
readonly baselined: number;
|
|
16
|
+
readonly kept: readonly Violation[];
|
|
17
|
+
readonly loose: readonly StaleBaselineEntry[];
|
|
18
|
+
readonly regressions: readonly Regression[];
|
|
19
|
+
readonly stale: readonly StaleBaselineEntry[];
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
export const countOf = (violations:
|
|
22
|
+
export const countOf = (violations: readonly Violation[]): number => violations.reduce((total, violation) => total + (violation.count ?? 1), 0);
|
|
24
23
|
|
|
25
|
-
export const applyBaseline = (
|
|
26
|
-
violations: ReadonlyArray<Violation>,
|
|
27
|
-
entries: ReadonlyArray<BaselineEntry>,
|
|
28
|
-
levels: ReadonlyMap<string, Level>,
|
|
29
|
-
): BaselineCheck => {
|
|
24
|
+
export const applyBaseline = (violations: readonly Violation[], entries: readonly BaselineEntry[], rules: RuleIndex): BaselineCheck => {
|
|
30
25
|
const groups = groupBy(violations, (violation) => keyOf(violation.rule, violation.file));
|
|
31
26
|
const covered = new Set<string>();
|
|
32
27
|
const regressions: Regression[] = [];
|
|
@@ -35,10 +30,10 @@ export const applyBaseline = (
|
|
|
35
30
|
for (const entry of entries) {
|
|
36
31
|
const group = groups.get(keyOf(entry.rule, entry.file)) ?? [];
|
|
37
32
|
if (group.length === 0) {
|
|
38
|
-
const level =
|
|
33
|
+
const level = levelOf(rules, entry.rule);
|
|
39
34
|
(level === undefined || level === "off" ? stale : loose).push({
|
|
40
35
|
entry,
|
|
41
|
-
problem: unusedEntryProblem(
|
|
36
|
+
problem: unusedEntryProblem(rules, entry.rule, "has no violations left"),
|
|
42
37
|
});
|
|
43
38
|
continue;
|
|
44
39
|
}
|
package/src/baseline/format.ts
CHANGED
|
@@ -3,17 +3,17 @@ import { type Decoded, decodeWith } from "../decoded.ts";
|
|
|
3
3
|
import { keyOf } from "../engine/violation.ts";
|
|
4
4
|
|
|
5
5
|
const Line = Schema.Struct({
|
|
6
|
+
count: Schema.Int.check(Schema.isGreaterThan(0)),
|
|
6
7
|
path: Schema.NonEmptyString,
|
|
7
8
|
rule: Schema.NonEmptyString,
|
|
8
|
-
count: Schema.Int.check(Schema.isGreaterThan(0)),
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
const standard = Schema.toStandardSchemaV1(Schema.fromJsonString(Line), { parseOptions: { errors: "all", onExcessProperty: "error" } });
|
|
12
12
|
|
|
13
13
|
export interface BaselineEntry {
|
|
14
|
-
readonly rule: string;
|
|
15
|
-
readonly file: string;
|
|
16
14
|
readonly count: number;
|
|
15
|
+
readonly file: string;
|
|
16
|
+
readonly rule: string;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const codepoints = (left: string, right: string): number => (left < right ? -1 : Number(left > right));
|
|
@@ -27,7 +27,7 @@ export const linesOf = (raw: string | undefined): ReadonlyArray<{ readonly line:
|
|
|
27
27
|
.map((text, index) => ({ line: index + 1, text }))
|
|
28
28
|
.filter((row) => row.text.trim() !== "");
|
|
29
29
|
|
|
30
|
-
export const decodeBaseline = async (raw: string | undefined): Promise<Decoded<
|
|
30
|
+
export const decodeBaseline = async (raw: string | undefined): Promise<Decoded<readonly BaselineEntry[]>> => {
|
|
31
31
|
const issues: string[] = [];
|
|
32
32
|
const entries: BaselineEntry[] = [];
|
|
33
33
|
const seen = new Set<string>();
|
|
@@ -47,9 +47,11 @@ export const decodeBaseline = async (raw: string | undefined): Promise<Decoded<R
|
|
|
47
47
|
return issues.length === 0 ? { _tag: "Valid", value: entries } : { _tag: "Invalid", issues };
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
const LINE_KEYS = ["path", "rule", "count"];
|
|
51
|
+
|
|
52
|
+
export const encodeEntry = (entry: BaselineEntry): string => JSON.stringify({ count: entry.count, path: entry.file, rule: entry.rule }, LINE_KEYS);
|
|
51
53
|
|
|
52
|
-
export const encodeBaseline = (entries:
|
|
54
|
+
export const encodeBaseline = (entries: readonly BaselineEntry[]): string =>
|
|
53
55
|
[...entries]
|
|
54
56
|
.sort(byPathAndRule)
|
|
55
57
|
.map((entry) => `${encodeEntry(entry)}\n`)
|
package/src/baseline/guard.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { groupBy, keyOf } from "../engine/violation.ts";
|
|
1
|
+
import { covers, groupBy, keyOf } from "../engine/violation.ts";
|
|
2
2
|
import type { BaselineEntry } from "./format.ts";
|
|
3
3
|
|
|
4
4
|
export type GuardProblem =
|
|
@@ -8,16 +8,16 @@ export type GuardProblem =
|
|
|
8
8
|
| { readonly _tag: "NothingAdopted"; readonly rule: string };
|
|
9
9
|
|
|
10
10
|
export interface GuardResult {
|
|
11
|
-
readonly
|
|
11
|
+
readonly adopted: readonly string[];
|
|
12
12
|
readonly moved: number;
|
|
13
|
-
readonly
|
|
13
|
+
readonly problems: readonly GuardProblem[];
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export const guardBaseline = (
|
|
17
|
-
base:
|
|
18
|
-
working:
|
|
17
|
+
base: readonly BaselineEntry[],
|
|
18
|
+
working: readonly BaselineEntry[],
|
|
19
19
|
renames: ReadonlyMap<string, string>,
|
|
20
|
-
adopt:
|
|
20
|
+
adopt: readonly string[],
|
|
21
21
|
): GuardResult => {
|
|
22
22
|
const before = new Map(base.map((entry) => [keyOf(entry.rule, entry.file), entry]));
|
|
23
23
|
const covered = new Set(base.map((entry) => entry.rule));
|
|
@@ -36,12 +36,13 @@ export const guardBaseline = (
|
|
|
36
36
|
moved += 1;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
+
const adopted = (rule: string): boolean => adopt.some((name) => covers(name, rule));
|
|
39
40
|
const fresh = [...byRule.entries()].filter(([rule]) => !covered.has(rule));
|
|
40
|
-
for (const [rule, entries] of fresh.filter(([rule]) => !
|
|
41
|
+
for (const [rule, entries] of fresh.filter(([rule]) => !adopted(rule))) {
|
|
41
42
|
problems.push({ _tag: "Unadopted", entries: entries.length, rule });
|
|
42
43
|
}
|
|
43
|
-
for (const
|
|
44
|
-
problems.push({ _tag: "NothingAdopted", rule });
|
|
44
|
+
for (const name of adopt.filter((candidate) => ![...byRule.keys()].some((rule) => covers(candidate, rule)))) {
|
|
45
|
+
problems.push({ _tag: "NothingAdopted", rule: name });
|
|
45
46
|
}
|
|
46
|
-
return { adopted: fresh.map(([rule]) => rule).filter(
|
|
47
|
+
return { adopted: fresh.map(([rule]) => rule).filter(adopted), moved, problems };
|
|
47
48
|
};
|
package/src/baseline/legacy.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface LegacyEntry extends BaselineEntry {
|
|
|
19
19
|
readonly measure?: number | undefined;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export const decodeLegacyBaseline = async (raw: string): Promise<Decoded<
|
|
22
|
+
export const decodeLegacyBaseline = async (raw: string): Promise<Decoded<readonly LegacyEntry[]>> => {
|
|
23
23
|
const decoded = await decodeWith(standard, raw);
|
|
24
24
|
if (decoded._tag === "Invalid") {
|
|
25
25
|
return decoded;
|
|
@@ -30,9 +30,9 @@ export const decodeLegacyBaseline = async (raw: string): Promise<Decoded<Readonl
|
|
|
30
30
|
return { _tag: "Valid", value: entries };
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
export const measured = (legacy:
|
|
33
|
+
export const measured = (legacy: readonly LegacyEntry[]): boolean => legacy.some((entry) => entry.measure !== undefined);
|
|
34
34
|
|
|
35
|
-
export const convertLegacy = (legacy:
|
|
35
|
+
export const convertLegacy = (legacy: readonly LegacyEntry[], violations: readonly Violation[]): readonly BaselineEntry[] => {
|
|
36
36
|
const current = groupBy(violations, (violation) => keyOf(violation.rule, violation.file));
|
|
37
37
|
return legacy.flatMap(({ count, file, measure, rule }) => {
|
|
38
38
|
if (measure === undefined) {
|
package/src/baseline/rewrite.ts
CHANGED
|
@@ -7,7 +7,7 @@ interface Row {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
// An untouched entry keeps its exact line and a new one goes before the first line that sorts after it, so two branches conflict only on the same or neighbouring entries.
|
|
10
|
-
export const rewriteBaseline = (raw: string | undefined, before:
|
|
10
|
+
export const rewriteBaseline = (raw: string | undefined, before: readonly BaselineEntry[], after: readonly BaselineEntry[]): string => {
|
|
11
11
|
const wanted = new Map(after.map((entry) => [keyOf(entry.rule, entry.file), entry]));
|
|
12
12
|
const lines = linesOf(raw);
|
|
13
13
|
const rows: Row[] = before.flatMap((old, index) => {
|
package/src/baseline/update.ts
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { groupBy, keyOf, type Violation } from "../engine/violation.ts";
|
|
1
|
+
import { covers, groupBy, keyOf, levelOf, type RuleIndex, type Violation } from "../engine/violation.ts";
|
|
3
2
|
import { countOf } from "./compare.ts";
|
|
4
3
|
import type { BaselineEntry } from "./format.ts";
|
|
5
4
|
|
|
6
5
|
export type Adoption =
|
|
7
|
-
| { readonly _tag: "Refused"; readonly reasons:
|
|
8
|
-
| { readonly _tag: "Adopted"; readonly entries:
|
|
6
|
+
| { readonly _tag: "Refused"; readonly reasons: readonly string[] }
|
|
7
|
+
| { readonly _tag: "Adopted"; readonly entries: readonly BaselineEntry[]; readonly added: number; readonly replaced: number };
|
|
9
8
|
|
|
10
9
|
export interface Pruned {
|
|
11
|
-
readonly entries:
|
|
10
|
+
readonly entries: readonly BaselineEntry[];
|
|
11
|
+
readonly lowered: number;
|
|
12
12
|
readonly moved: number;
|
|
13
13
|
readonly removed: number;
|
|
14
|
-
readonly lowered: number;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
const record = (violations:
|
|
16
|
+
const record = (violations: readonly Violation[]): readonly BaselineEntry[] =>
|
|
18
17
|
[...groupBy(violations, (violation) => keyOf(violation.rule, violation.file)).values()].flatMap((group) => {
|
|
19
18
|
const first = group[0];
|
|
20
19
|
if (first === undefined) {
|
|
@@ -24,8 +23,8 @@ const record = (violations: ReadonlyArray<Violation>): ReadonlyArray<BaselineEnt
|
|
|
24
23
|
return count > 0 ? [{ count, file: first.file, rule: first.rule }] : [];
|
|
25
24
|
});
|
|
26
25
|
|
|
27
|
-
const refusal = (id: string,
|
|
28
|
-
const level =
|
|
26
|
+
const refusal = (id: string, index: RuleIndex): readonly string[] => {
|
|
27
|
+
const level = levelOf(index, id);
|
|
29
28
|
if (level === undefined) {
|
|
30
29
|
return [`${id}: no built-in or local rule has this id.`];
|
|
31
30
|
}
|
|
@@ -33,27 +32,28 @@ const refusal = (id: string, levels: ReadonlyMap<string, Level>): ReadonlyArray<
|
|
|
33
32
|
};
|
|
34
33
|
|
|
35
34
|
export const adopt = (
|
|
36
|
-
existing:
|
|
37
|
-
rules:
|
|
38
|
-
violations:
|
|
39
|
-
|
|
35
|
+
existing: readonly BaselineEntry[] | undefined,
|
|
36
|
+
rules: readonly string[],
|
|
37
|
+
violations: readonly Violation[],
|
|
38
|
+
index: RuleIndex,
|
|
40
39
|
): Adoption => {
|
|
41
40
|
if (existing !== undefined && rules.length === 0) {
|
|
42
41
|
return { _tag: "Refused", reasons: ["a baseline exists. Record a rule with --rule <id>, or drop fixed debt with prune."] };
|
|
43
42
|
}
|
|
44
|
-
const reasons = rules.flatMap((id) => refusal(id,
|
|
43
|
+
const reasons = rules.flatMap((id) => refusal(id, index));
|
|
45
44
|
if (reasons.length > 0) {
|
|
46
45
|
return { _tag: "Refused", reasons };
|
|
47
46
|
}
|
|
48
|
-
const
|
|
49
|
-
const
|
|
47
|
+
const named = (rule: string): boolean => rules.some((name) => covers(name, rule));
|
|
48
|
+
const kept = (existing ?? []).filter((entry) => !named(entry.rule));
|
|
49
|
+
const adopted = violations.filter((violation) => violation.level === "error" && (rules.length === 0 || named(violation.rule)));
|
|
50
50
|
const added = record(adopted);
|
|
51
51
|
return { _tag: "Adopted", added: added.length, entries: [...kept, ...added], replaced: (existing ?? []).length - kept.length };
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
export interface Scope {
|
|
55
|
-
readonly moves: ReadonlyMap<string, string>;
|
|
56
55
|
readonly files?: ReadonlySet<string> | undefined;
|
|
56
|
+
readonly moves: ReadonlyMap<string, string>;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
const inScope = (entry: BaselineEntry, scope: Scope): boolean =>
|
|
@@ -71,9 +71,9 @@ const destination = (
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
export const prune = (
|
|
74
|
-
existing:
|
|
75
|
-
violations:
|
|
76
|
-
|
|
74
|
+
existing: readonly BaselineEntry[],
|
|
75
|
+
violations: readonly Violation[],
|
|
76
|
+
index: RuleIndex,
|
|
77
77
|
scope: Scope = { moves: new Map() },
|
|
78
78
|
): Pruned => {
|
|
79
79
|
const current = new Map(record(violations).map((entry) => [keyOf(entry.rule, entry.file), entry]));
|
|
@@ -83,7 +83,7 @@ export const prune = (
|
|
|
83
83
|
if (!inScope(before, scope)) {
|
|
84
84
|
return [{ after: before, before }];
|
|
85
85
|
}
|
|
86
|
-
const level =
|
|
86
|
+
const level = levelOf(index, before.rule);
|
|
87
87
|
const now = current.get(keyOf(before.rule, before.file)) ?? destination(before, current, scope.moves, taken);
|
|
88
88
|
if (now === undefined || level === undefined || level === "off") {
|
|
89
89
|
return [];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type BiomeRun, runBiome } from "./run.ts";
|
|
3
|
+
|
|
4
|
+
const Position = Schema.Struct({ line: Schema.Int });
|
|
5
|
+
|
|
6
|
+
const Diagnostic = Schema.Struct({
|
|
7
|
+
category: Schema.optionalKey(Schema.String),
|
|
8
|
+
location: Schema.Struct({ path: Schema.optionalKey(Schema.String), start: Schema.optionalKey(Position) }),
|
|
9
|
+
message: Schema.String,
|
|
10
|
+
severity: Schema.String,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type Diagnostic = typeof Diagnostic.Type;
|
|
14
|
+
|
|
15
|
+
const Report = Schema.Struct({
|
|
16
|
+
diagnostics: Schema.Array(Diagnostic),
|
|
17
|
+
summary: Schema.Struct({ changed: Schema.Int }),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export type Report = typeof Report.Type;
|
|
21
|
+
|
|
22
|
+
const decodeReport = Schema.decodeUnknownOption(Schema.fromJsonString(Report));
|
|
23
|
+
|
|
24
|
+
const failure = (args: readonly string[], run: BiomeRun): Error =>
|
|
25
|
+
new Error(`biome ${args.join(" ")} exited ${run.code} without a report:\n${[run.stdout, run.stderr].join("\n").trim()}`);
|
|
26
|
+
|
|
27
|
+
export async function biomeReport(root: string, args: readonly string[]): Promise<Report> {
|
|
28
|
+
const command = [...args, "--reporter=json", "--max-diagnostics=none", "."];
|
|
29
|
+
const run = await runBiome(root, command);
|
|
30
|
+
const report = decodeReport(run.stdout.trim());
|
|
31
|
+
if (report._tag === "None") {
|
|
32
|
+
throw failure(command, run);
|
|
33
|
+
}
|
|
34
|
+
return report.value;
|
|
35
|
+
}
|
package/src/biome/run.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import process from "node:process";
|
|
4
|
+
|
|
5
|
+
export interface BiomeRun {
|
|
6
|
+
readonly code: number;
|
|
7
|
+
readonly stderr: string;
|
|
8
|
+
readonly stdout: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const BIN = createRequire(import.meta.url).resolve("@biomejs/biome/bin/biome");
|
|
12
|
+
|
|
13
|
+
export function runBiome(root: string, args: readonly string[]): Promise<BiomeRun> {
|
|
14
|
+
return new Promise((resolve, reject) => {
|
|
15
|
+
execFile(process.execPath, [BIN, ...args, "--colors=off"], { cwd: root, maxBuffer: 2 ** 30 }, (error, stdout, stderr) => {
|
|
16
|
+
if (error !== null && typeof error.code !== "number") {
|
|
17
|
+
reject(error);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
resolve({ code: error === null ? 0 : Number(error.code), stderr, stdout });
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|