Skip to content

lint: re-apply unused-vars codemod against current main (518 → 67)#55

Closed
adm01-debug wants to merge 1 commit into
mainfrom
claude/lint-unused-destructured
Closed

lint: re-apply unused-vars codemod against current main (518 → 67)#55
adm01-debug wants to merge 1 commit into
mainfrom
claude/lint-unused-destructured

Conversation

@adm01-debug
Copy link
Copy Markdown
Owner

Summary

R7.2 — re-applies the unused-vars codemod from PR #37 against current main. 457 transforms across 269 files. Idempotent with PR #37 (if both merge, second is a no-op).

Metric Before After
no-unused-vars 518 67 (−451)
tsc --noEmit
npm run test 90 baseline 90 (same)

Edits applied

Kind Count Transform
Imports removed 298 Drop unused named/default specifier; drop full line if brace becomes empty
Destructure renamed 67 { unused }{ _unused } (safer than removal: siblings may be used)
Locals renamed 47 const xconst _x (RHS may have side effects)
Params renamed 45 (x) =>(_x) => (preserves arity)
Skipped 61 Already prefixed or locator failed

What's left (67 cases)

Destructured object args inside multi-line function signatures:

function VideoGrid({ filteredVideos, variantMap, ... }) {

Renaming variantMap_variantMap would change the destructure target name and break the binding. Proper fix is aliasing ({ variantMap: _variantMap }) which is too case-by-case for a regex codemod.

https://claude.ai/code/session_01KWeDG


Generated by Claude Code

Same logic as PR #37, re-applied against current main since #37
hasn't merged yet. Idempotent: if both PRs land, second is a no-op.

## Edits applied

  imports     298  Removed unused named/default imports (drop full
                  line if brace becomes empty)
  destructure  67  Renamed unused destructured locals to '_name'
  locals       47  Renamed unused 'const'/'let' locals to '_name'
  params       45  Renamed unused function args to '_name'
  skipped      61  Already-prefixed (_name) or locator failed

  TOTAL       457 transforms across 269 files

## Remaining 67 cases

Destructured object args inside multi-line function signatures
(e.g. 'function VideoGrid(\{ filteredVideos, variantMap, ... \})') —
renaming would change the destructure target name and break the
binding. Proper fix is aliasing ('\{ variantMap: \_variantMap \}')
which is too case-by-case for a regex codemod.

## Validation

  no-unused-vars   518 → 67 violations
  tsc --noEmit     exit 0
  tests            no regressions
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f3b5171a-ef5b-4129-8b77-916b390e50cf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/lint-unused-destructured

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

2 participants