0.2.1 • Published 1 month ago

@sushichan044/eslint-todo v0.2.1

Weekly downloads
-
License
-
Repository
github
Last release
1 month ago

@sushichan044/eslint-todo

Ask DeepWiki

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

Simple tool to temporarily disable existing ESLint violations like .rubocop_todo.yml in RuboCop.

It also has a utility that helps reducing ignored violations at your pace.

This tool is designed to work with AI Agents such as Devin.

And now eslint-todo also provides MCP server! See: Use as MCP server

!NOTE This tool only supports ESLint Flat Config with ES Module.

If you want to use this tool to supress ESLint errors when migrating to ESLint Flat Config,

you first need to create Flat Config and then use this tool. Maybe utilities like @eslint/compat can help you.

Installation

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

Requires:

  • ES Module
  • ESLint: ^8.57.0 || ^9.0.0
    • Flat Config
  • Node.js: >= 20.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

Generate ESLint Todo file

npx @sushichan044/eslint-todo

Correct ignored errors

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

In this mode, eslint-todo searches the todo file with the limit from config file or CLI. And it removes one matching rule from the todo file.

This allows ESLint to detect that rule as a violation again. For safety, only auto-fixable rules are searched by default.

By default, it searches for rules that can be automatically fixed and have less than or equal to 100 violations.

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, even when flags exclusive to these CLIs are passed, the config file will not be ignored.

  • --correct
  • --mcp

Configuration File (recommended)

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.

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}"
      ]
    }
  }
}
0.1.0

4 months ago

0.2.1

1 month ago

0.1.2

3 months ago

0.2.0

1 month ago

0.1.1

4 months ago

0.1.4

3 months ago

0.1.3

3 months ago

0.0.7

4 months ago

0.1.5

2 months ago

0.0.6

4 months ago

0.0.3

4 months ago

0.0.5

4 months ago

0.0.4

4 months ago

0.0.2

5 months ago

0.0.1

5 months ago