Loops

Fix ESLint Errors

Runs ESLint across your project and fixes every reported error one file at a time.

Anyone whose linter has piled up hundreds of warnings after a large AI-generated feature landed at once.

The problem

A full ESLint run dumps errors from every file in the project into one long list. Scrolling through it and fixing each rule violation by hand is tedious, and it is easy to lose track of which files are still broken.

1. Work list

The command that lists every item. No AI involved.

npx eslint . --format json | jq -r '.[] | select(.errorCount > 0) | .filePath'

2. Unit of work

One item is one file that has at least one ESLint error.

3. The check

The checker runs npx eslint <file> on just that file. Exit code 0 means ESLint found nothing wrong. Exit code 1 means errors remain, and the checker prints the exact rule name and line number back to the AI.

4. Stopping rule

Each file gets up to 3 fix attempts before moving to a quarantine file, and the loop ends when every file in the work list has been handled.

What this cannot catch

ESLint only flags the rules your config has turned on. Clean output does not mean the code is correct.

Build it

Install justloopit, then describe this task in your AI coding tool. It will ask about your project, then write the checker, the runner, and the spec.

Install

Build a loop