Skip to content

feat(lint): tier knip dead-code behind --strict, restructure output#51

Draft
natemoo-re wants to merge 1 commit into
mainfrom
feat/lint-tiers-and-output
Draft

feat(lint): tier knip dead-code behind --strict, restructure output#51
natemoo-re wants to merge 1 commit into
mainfrom
feat/lint-tiers-and-output

Conversation

@natemoo-re

Copy link
Copy Markdown
Member

Summary

Session-log analysis showed bsh lint's signal was drowning in noise: "1 error, 41 warnings" reports trained agents to skim past everything, and knip's dead-code checks (909+ unused-file hits) fired constantly mid-implementation — an export is "unused" until its consumer exists.

  • Errors print in full; warnings collapse to per-rule counts (--warnings expands). Warnings never affect the exit code, so this keeps actual failures visible.
  • --format json for a machine-readable report ({ summary, violations }). Use pnpm -s to keep pnpm's banner out of stdout.
  • knip dead-code issues (unused exports/types/files) require --strict — a commit-time gate, not a TDD-loop gate. Dependency hygiene (unused deps/devDeps) still always runs.
  • Fix: tsgo was silently type-checking nothing. File arguments made it skip the project tsconfig (TS5112), and that error line didn't match the report parser — so default runs reported zero type errors. Type checking now always runs in project mode; explicit targets filter the report after the fact. This immediately surfaced a real pre-existing TS2345 in fixture.test.ts.
  • Default oxlint target widened from ./src to project-wide (gitignored paths respected), matching knip/tsgo scope.
  • unicorn/consistent-function-scoping and no-underscore-dangle turned off — they fired frequently but were never deliberately enabled (inherited from categories).
  • --fix now exits non-zero only when errors remain (previously any warning failed the run).

Validation

Includes changeset (minor).

- errors in full, warnings collapsed to per-rule counts (--warnings to show)
- --format json machine-readable report
- knip unused-export/type/file require --strict; dep hygiene always runs
- fix tsgo silently checking nothing (TS5112): always project mode,
  explicit targets filter the report after the fact
- default oxlint target widened from ./src to project-wide
- disable unicorn/consistent-function-scoping and no-underscore-dangle
- --fix exits non-zero only on remaining errors
@changeset-bot

changeset-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 795c65d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bomb.sh/tools Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@bomb.sh/tools@51

commit: 795c65d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant