agentleFS
peopleforresterpeopleforrester/claude-dotfiles/skills/maintenance/lint-fix/SKILL.md

lint-fix

Skill3 starsChanged 8 months agoMITView on GitHub

Fix linting errors systematically across the codebase

11 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use commit.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SentrySkill

    commit

    Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When a rule shouldn't apply:

    line 177
  2. Distinctive:

    Commit after each category

    line 202
  3. Distinctive:

    Don't suppress warnings without good reason

    line 204
  4. Distinctive:

    Update lint config if rules don't fit project

    line 205

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/lint-fix - Iterative Lint Fixing

Fix linting errors systematically across the codebase.

Usage

/lint-fix                    # Fix all linting errors
/lint-fix src/               # Fix errors in specific directory
/lint-fix --check            # Check without fixing (dry run)

Process

1. Run Initial Lint Check

Get overview of all issues:

# JavaScript/TypeScript
npm run lint
# or
npx eslint . --format=compact

# Python
ruff check .
# or
flake8 .

# Rust
cargo clippy

# Go
golangci-lint run

2. Categorize Issues

Group errors by type:

CategoryPriorityAuto-fixable
Syntax errorsCriticalNo
Type errorsHighNo
FormattingLowYes
Best practicesMediumSometimes
Code styleLowYes

3. Auto-Fix What's Possible

Run auto-fix commands:

# ESLint
npx eslint . --fix

# Prettier
npx prettier --write .

# Python (ruff)
ruff check . --fix
ruff format .

# Python (black)
black .

# Rust
cargo fmt
cargo clippy --fix

# Go
gofmt -w .
golangci-lint run --fix

4. Handle Remaining Errors

For errors that can't be auto-fixed:

## Manual Fixes Required

### Error 1: [Rule name]
**File**: src/components/Button.tsx:15
**Issue**: [Description]
**Fix**:
```typescript
// Before
const Button = (props) => ...

// After
const Button: React.FC<ButtonProps> = (props) => ...

Error 2: [Rule name]

...


### 5. Verify Fixes

After all fixes:

```bash
# Run lint again - should be clean
npm run lint

# Run tests to ensure fixes didn't break anything
npm test

# Run type check
npm run typecheck

Common Lint Rules & Fixes

ESLint

RuleIssueFix
no-unused-varsUnused variableRemove or use it
prefer-constlet for never-reassignedChange to const
no-consoleConsole statementRemove or disable rule
@typescript-eslint/no-explicit-anyUsing anyAdd proper types

Ruff / Flake8

RuleIssueFix
E501Line too longBreak line or disable
F401Unused importRemove import
F841Unused variableRemove or prefix with _
E302Missing blank linesAdd blank lines

Clippy

RuleIssueFix
needless_returnExplicit returnRemove return keyword
clone_on_copyCloning Copy typeRemove .clone()
redundant_closureUnnecessary closureUse function directly

Batch Processing Strategy

For large codebases:

## Lint Fix Plan

### Phase 1: Auto-fixable (Low risk)
- [ ] Run prettier/formatter
- [ ] Run eslint --fix
- [ ] Commit: "style: auto-fix formatting"

### Phase 2: Safe manual fixes
- [ ] Fix unused imports
- [ ] Fix unused variables
- [ ] Commit: "refactor: remove unused code"

### Phase 3: Type improvements
- [ ] Replace `any` with proper types
- [ ] Add missing type annotations
- [ ] Commit: "types: improve type safety"

### Phase 4: Logic fixes
- [ ] Fix potential bugs (eslint warnings)
- [ ] Address security concerns
- [ ] Commit: "fix: address lint warnings"

Suppressing Warnings

When a rule shouldn't apply:

// Single line
// eslint-disable-next-line no-console
console.log('debug');

// Block
/* eslint-disable no-console */
console.log('start');
console.log('end');
/* eslint-enable no-console */

// File level (at top)
/* eslint-disable no-console */
# Ruff / Flake8
x = 1  # noqa: F841

Tips

  • Fix one category at a time
  • Commit after each category
  • Run tests frequently
  • Don't suppress warnings without good reason
  • Update lint config if rules don't fit project

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.