Skip to content

A simple tool to gradually resolve a large number of ESLint violations.

Notifications You must be signed in to change notification settings

sushichan044/eslint-todo

Repository files navigation

@sushichan044/eslint-todo

A simple tool to gradually resolve a large number of ESLint violations.

It allows you to temporarily disable violations and fix them at your own pace.

Ask DeepWiki

Caution

This library will be subject to destructive changes based on ESLint bulk suppressions.

Installation

npm install --save-dev eslint @sushichan044/eslint-todo

Requires:

  • ES Module
  • ESLint: ^8.57.0 || ^9.0.0
    • Flat Config Required
    • If you are using legacy config, you must migrate into flat config first.
  • Node.js: ^20.12.0 || ^22.0.0 || >=24.0.0
    • May work in Deno, but not tested.

Getting Started

  1. Add eslint-todo config at the bottom of your configs. Do not forget await.

    // example: eslint.config.js
    + import eslintConfigTodo from '@sushichan044/eslint-todo/eslint';
    
    export default [
      // your existing configs,
    + ...(await eslintConfigTodo())
    ]
  2. Run eslint-todo to generate ESLint Todo file at the directory where eslint.config.js is placed.

    npx @sushichan044/eslint-todo

Usage

1. Generate ESLint Todo file to temporarily suppress existing violations

npx @sushichan044/eslint-todo

2. Correct ignored errors

Add --correct flag to launch eslint-todo with correct mode.

In this mode, you can make suppressed violations detectable again according to flexible conditions.

For example, to resolve 40 violations from any rule other than @typescript-eslint/no-explicit-any, specify it as follows.

eslint-todo --correct \
  --correct.autoFixableOnly false \
  --correct.partialSelection \
  --correct.exclude.rules '@typescript-eslint/no-explicit-any' \
  --correct.limit.count 40 \
  --correct.limit.type violation

This will allow ESLint to detect the errors again, enabling you to have them fixed by AI or other tools.

Configuration

Configuration via CLI flags

You can config eslint-todo by passing a flag to the CLI. Use npx eslint-todo --help to see all available options.

Warning

If you specified any config via CLI flags, your config file will be ignored completely.

Exceptionally, these flags have no effect on this behavior:

  • --correct
  • --mcp

Configuration File

Just create eslint-todo.config.{js,ts}:

// example: eslint-todo.config.ts
import { defineConfig } from '@sushichan044/eslint-todo/config';

export default defineConfig({
  correct: {
    limit: {
      count: 30,
      type: "violation",
    },
  },
});

You can check all available options at here.

Want to use JSON?

Sure!

{
  "$schema": "node_modules/@sushichan044/eslint-todo/config-schema.json",
  "correct": {
    "limit": {
      "count": 30,
      "type": "violation"
    }
  }
}

Use as MCP server (Experimental)

eslint-todo provides some useful tools to AI Agents via MCP.

You mus specify --mcp and --root <root path>.

Setup for VSCode

update .vscode/mcp.json in your workspace:

{
  "servers": {
    "eslint-todo": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@sushichan044/eslint-todo",
        "--mcp",
        "--root",
        "${workspaceFolder}"
      ]
    }
  }
}

About

A simple tool to gradually resolve a large number of ESLint violations.

Topics

Resources

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Contributors 6