Skip to content

Instantly share code, notes, and snippets.

@SilenNaihin
Created January 28, 2026 03:01
Show Gist options
  • Select an option

  • Save SilenNaihin/a75cf56ac7aeae3dbf5c4a0ee754daf4 to your computer and use it in GitHub Desktop.

Select an option

Save SilenNaihin/a75cf56ac7aeae3dbf5c4a0ee754daf4 to your computer and use it in GitHub Desktop.
Claude Code: Lint Quality command

Lint Quality

Run code quality checks to find duplication and dead code. Install the tools first if they're not in package.json.

Check and Install

First check if jscpd and knip are installed:

cat package.json | grep -E "jscpd|knip"

If not installed, install them:

npm install -D jscpd knip
npx knip init

Add scripts to package.json if missing:

{
  "scripts": {
    "lint:dupes": "jscpd src/",
    "lint:dead": "knip",
    "lint:quality": "npm run lint:dupes && npm run lint:dead"
  }
}

Run Quality Checks

Run both tools:

npm run lint:dupes
npm run lint:dead

Review Results

After running, report:

  1. jscpd: Number of duplicate code blocks and duplication percentage
  2. knip: Unused files, unused dependencies, unused exports, unused types

Fix Issues

For each issue found:

  • Duplicate code: Extract to shared utility or component
  • Unused files: Delete them
  • Unused dependencies: Remove from package.json
  • Unused exports: Remove the export or delete if truly unused

Commit the cleanup changes when done.

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