Skip to content

v0.8.0

Choose a tag to compare

@PerfectPan PerfectPan released this 15 Nov 06:43
· 5 commits to main since this release
21d4b41

What changed

  • Two path-free jscpd profiles. @perfectpan/lint-config/jscpd.json is the gate: minLines: 6, minTokens: 40, threshold: 0, mode: "mild" and failOnEmpty: true, so any reported clone fails the run and so does a scan that filters out every file. @perfectpan/lint-config/jscpd-audit.json is the audit: the same floor plus consistent identifier renaming, preserved literals and function-level AST similarity (similarity: 0.8, minNodes: 20), with no threshold and a JSON report whose kind and method fields classify each candidate. Scan roots, formats, ignores and output paths stay in the consuming repository.
  • @perfectpan/lint-config/knip exports the shared Knip policy as plain data: treatConfigHintsAsErrors and treatTagHintsAsErrors are on, so an unresolved configuration or tag hint fails the run. Spread it into the repository's own knip.ts; entries, projects, paths, workspaces and exceptions stay there.
  • jscpd (>=5.4.2 <6) and knip (>=6.45.1 <7) are new optional peers. No runtime dependency was added, and the oxlint, oxfmt, tsconfig and vite-plus exports are unchanged.
  • docs/decisions.md records why each profile value and the Knip policy were chosen.

What newly fails

Nothing for an existing consumer: the profiles and the Knip policy apply only to commands that reference them. A repository that adopts the gate fails on any clone of at least six lines and forty tokens, and on an empty scan; narrow its roots or ignores rather than raising the threshold. A repository that spreads the Knip policy fails on configuration or tag hints; resolve the hint in its knip.ts. The audit profile reports candidates and has no failing threshold.

Impact

Existing lint, format and type-check results are unchanged for every consumer. In PerfectPan/rivus-agent, the first adopter, the existing gate keeps 548 files and 0 clones, the audit reports 1,538 candidates across 1,018 files, and Knip reports findings with no configuration or tag hints.

Upgrade

Change #v0.7.1 to #v0.8.0 in the @perfectpan/lint-config dependency, then reinstall. To adopt the duplicate checks, install jscpd and pass --config node_modules/@perfectpan/lint-config/jscpd.json (or jscpd-audit.json) with the repository's own roots and ignores. To adopt the Knip policy, install knip and spread knip from @perfectpan/lint-config/knip into knip.ts.