{"id":13596809,"url":"https://github.com/mizdra/eslint-interactive","last_synced_at":"2026-02-24T14:02:47.162Z","repository":{"id":37482417,"uuid":"322817876","full_name":"mizdra/eslint-interactive","owner":"mizdra","description":"The CLI tool to fix huge number of ESLint errors","archived":false,"fork":false,"pushed_at":"2024-09-28T12:34:26.000Z","size":3164,"stargazers_count":397,"open_issues_count":17,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-11T14:28:48.917Z","etag":null,"topics":["eslint","javascript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mizdra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"mizdra"}},"created_at":"2020-12-19T10:08:31.000Z","updated_at":"2025-04-11T02:49:20.000Z","dependencies_parsed_at":"2023-10-02T04:00:57.861Z","dependency_job_id":"334ab51f-f2c4-4834-91fe-4b79fdea8955","html_url":"https://github.com/mizdra/eslint-interactive","commit_stats":{"total_commits":1032,"total_committers":8,"mean_commits":129.0,"dds":0.08430232558139539,"last_synced_commit":"fea4c851641acd36b52ea0485b9db91de035f1b4"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizdra%2Feslint-interactive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizdra%2Feslint-interactive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizdra%2Feslint-interactive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizdra%2Feslint-interactive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mizdra","download_url":"https://codeload.github.com/mizdra/eslint-interactive/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248695438,"owners_count":21146954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eslint","javascript"],"created_at":"2024-08-01T16:02:49.153Z","updated_at":"2026-02-24T14:02:47.152Z","avatar_url":"https://github.com/mizdra.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Cover image\" src=\"./docs/cover.svg\" /\u003e\n\u003c/p\u003e\n\n\u003ch2 align=\"center\"\u003eThe CLI tool to fix huge number of ESLint errors\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cem\u003eQuick fixes, per rule.\u003c/em\u003e\n  \u003cbr /\u003e\n  \u003cem\u003e\n    Run \u003ccode\u003eeslint --fix\u003c/code\u003e,  disable per line, apply suggestions, and more!\n  \u003c/em\u003e\n  \u003cimg alt=\"Screenshot\" src=\"./docs/screenshot.png\" /\u003e\n\u003c/p\u003e\n\n## Motivation\n\nThe default ESLint output contains a lot of useful messages for developers, such as the source of the error and hints for fixing it. While this works for many use cases, it does not work well in situations where many messages are reported. For example, when introducing ESLint into a project, or when making big changes to the `eslint.config.js` of a project. In these situations, the output of ESLint can be quite large, making it difficult for developers to analyze the output. It is also difficult for the developer to fix messages mechanically, because messages of many rules are mixed up in the output.\n\nIn such the above situation, I think two things are important:\n\n- Show a summary of all problems (called _\"warnings\"_ or _\"errors\"_ in ESLint) so that the whole picture can be easily understood\n  - Showing the details of each problem will confuse developers.\n- Provide an efficient way to fix many problems\n  - `eslint --fix` is one of the best ways to fix problems efficiently, but it auto-fixes all rule problems at once.\n  - Depending on the rule, auto-fix may affect the behavior of the code, so auto-fix should be done with care.\n  - Therefore, it is desirable to provide a way to auto-fix in smaller units than `eslint --fix`.\n\nSo, I created a tool called `eslint-interactive` which wraps ESLint. This tool groups all problems by rule and outputs formatted number of problems per rule. In addition to the breakdown of problems per rule, it also outputs the number of fixable problems and other hints to help developers fix problems.\n\nIt also supports the following actions in addition to `eslint --fix`. All actions can be applied for each rule:\n\n- Display details of lint results\n- Run `eslint --fix`\n- Disable per line (`// eslint-disable-next-line \u003crule-name\u003e`)\n- Disable per file (`/* eslint-disable \u003crule-name\u003e */`)\n  - Add disable comments (`// eslint-disable \u003crule-name\u003e`) per file.\n- Convert error to warning per file (`/* eslint \u003crule-name\u003e: 1 */`)\n- Apply suggestions (via [Programmable API](./docs/programmable-api.md) only)\n  - Select one of the applicable suggestions and apply it. ([What's _suggestions_?](#whats-suggestions))\n  - Users can write JavaScript code to programmatically select the suggestion to be applied.\n  - See [Programmable API documentation](./docs/programmable-api.md#applySuggestions) for details.\n- Make forcibly fixable and run `eslint --fix` (via [Programmable API](./docs/programmable-api.md) only)\n  - This feature makes forcibly un-fixable problems fixable, and applies them.\n  - See [Programmable API documentation](./docs/programmable-api.md#makeFixableAndFix) for details.\n\n## Requirements\n\n- Node.js `^20.19.0 || ^22.12.0 || \u003e=24.0.0`\n- ESLint `\u003e=9.0.0`\n  - If you use ESLint `\u003c8.45.0`, use `eslint-interactive@^10`.\n- Flat config (`eslint.config.js`)\n  - If you use legacy config (`.eslintrc.*`), use `eslint-interactive@^12`.\n\n## Installation\n\n\u003e [!WARNING]\n\u003e Global installation of `eslint-interactive` is **not recommended** and is only supported on a **best-effort basis**. It is recommended to install `eslint-interactive` locally. See [FAQ](#why-is-global-installation-not-recommended).\n\n```console\n$ # For npm\n$ npm i -D eslint-interactive\n$ npx eslint-interactive --help\n\n$ # For yarn\n$ yarn add -D eslint-interactive\n$ yarn eslint-interactive --help\n\n$ # For pnpm\n$ pnpm add -D eslint-interactive\n$ pnpm exec eslint-interactive --help\n```\n\n## Usage\n\nThe interface of `eslint-interactive` is partially compatible with `eslint`. So, in most cases, simply replacing `eslint` with `eslint-interactive` in the command to lint (e.g. `eslint --quiet ./src`) will work. However, eslint-interactive is installed locally, so you need to add `npx`.\n\n```console\n$ # Show help\n$ npx eslint-interactive --help\neslint-interactive [...patterns]\n\nOptions:\n      --help                   Show help\n      --version                Show version number\n  -c, --config \u003cpath\u003e          Use this configuration, overriding config options if present\n      --format \u003cnameOrPath\u003e    Specify the format to be used for the \"Display problem messages\" action\n      --quiet                  Report errors only\n      --cache                  Only check changed files\n      --cache-location \u003cpath\u003e  Path to the cache file or directory\n      --flag \u003cname\u003e            Enable a feature flag (requires ESLint v9.6.0+)\n\nExamples:\n  eslint-interactive                          Lint all files in the project\n  eslint-interactive src test                 Lint specified directories\n  eslint-interactive 'src/**/*.{ts,tsx,vue}'  Lint with glob pattern\n```\n\n## Programmable API\n\nSee [Programmable API documentation](./docs/programmable-api.md).\n\n## Playground\n\nhttps://stackblitz.com/edit/eslint-interactive-playground?file=src%2Findex.ts\u0026view=editor\n\n## FAQ\n\n### What's _suggestions_?\n\n\u003e Excerpt a quote from [official ESLint documentation](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).\n\nIn some cases fixes aren't appropriate to be automatically applied, for example, if a fix potentially changes functionality or if there are multiple valid ways to fix a rule depending on the implementation intent. In such a case, the ESLint rule provides candidates for a fix. These are called _suggestions_.\n\nSuggestion can be one or more. The user has to manually decide if that fix should be applied or which fix should be applied because automatically applying of suggestion is inappropriate. For this reason, ESLint has stated that it will not officially provide a way to automatically apply suggestion ([ref](https://github.com/eslint/rfcs/tree/64b2511da6f2c10e1692671315459eb916aea53f/designs/2019-suggestions#:~:text=Unlike%20fixes%2C%20suggestion%20will%20not%20expose%20a%20new%20API%20function)). Instead, tools such as [`vscode-eslint`](https://github.com/microsoft/vscode-eslint) allow users to apply suggestions manually ([ref](https://github.com/microsoft/vscode-eslint/pull/814#issuecomment-587011529)).\n\n### Why is global installation not recommended?\n\n`eslint` is installed locally in most projects. In such a case, if `eslint-interactive` is installed globally, it will be installed in a different space than `eslint`. The space separation makes some resources of `eslint-interactive` inaccessible from `eslint` and may break them (ref: [#77](https://github.com/mizdra/eslint-interactive/issues/77)). For this reason, local installation is recommended. Global installation is supported, but only on a best-effort basis.\n\n### Is global installation prohibited?\n\nNo. `eslint-interactive` does not prohibit global installation. Global installation is supported on a best-effort basis because it has the advantage of saving installation effort. However, it is not recommended and users should be aware that some issues may arise.\n\nIf the global installation does not work, you can send a patch by pull request. However, whether the patch will be accepted depends on the case.\n\n### What's the difference from [eslint-nibble](https://github.com/IanVS/eslint-nibble)?\n\nA tool similar to `eslint-interactive` is [eslint-nibble](https://github.com/IanVS/eslint-nibble). Both tools solve the same problem, but `eslint-interactive` has some features that `eslint-nibble` does not have. For example, `eslint-interactive` prints the number of fixable problems per rule, while `eslint-nibble` does not. Also, `eslint-interactive` has various tricks to speed up the cycle of auto-fixing per-rule, but `eslint-nibble` auto-fixes once and terminates the process every time, so it is not as fast as `eslint-interactive`.\n\nI think these features are very important to solve the aforementioned problem. At first, I thought of implementing these features in `eslint-nibble`, but it required a major rewrite of the code, so I implemented it as a new tool `eslint-interactive`. Although `eslint-interactive` is a tool independent of `eslint-nibble`, it is influenced by the ideas of `eslint-nibble` and inherits some of its code. That's why you can find the names of [@IanVS](https://github.com/IanVS) and others in [the license of `eslint-interactive`](https://github.com/mizdra/eslint-interactive/blob/main/LICENSE).\n\nThanks, [@IanVS](https://github.com/IanVS).\n\n### What's the difference from [suppress-eslint-errors](https://github.com/amanda-mitchell/suppress-eslint-errors)?\n\n[suppress-eslint-errors](https://github.com/amanda-mitchell/suppress-eslint-errors) is an excellent tool to add comments for disable mechanically. Just like `eslint-interactive`, it allows you to add disable comments for each rule and leave the purpose of disable as a comment. There is no functional difference between the two, but there is a difference in the API used to insert the comments.\n\n`suppress-eslint-errors` uses [`jscodeshift`](https://github.com/facebook/jscodeshift) to insert comments. `jscodeshift` modifies the file in parallel, so `suppress-eslint-errors` has the advantage of being able to insert comments faster. However, `jscodeshift` cannot reuse the AST of ESLint, so you need to reparse the code in `jscodeshift`. This means that you have to pass `jscodeshift` the information it needs to parse your code (parser type, parser options). In fact, `suppress-eslint-errors` requires `--extensions` and `--parser` command line option. Normally, users specify the parsing options in `eslint.config.js`, so passing these options may seem cumbersome. Also, due to the difference in the way ESLint and `jscodeshift` parse, it may not be possible to insert comments correctly.\n\nOn the other hand, `eslint-interactive` uses [`ESLint.outputFixes`](https://eslint.org/docs/developer-guide/nodejs-api#-eslintoutputfixesresults) to insert comments. It uses ESLint's API to do everything from parsing the code to inserting the comments, so it works as expected in many cases. Also, `eslint-interactive` will parse the code using the parsing options specified in `eslint.config.js`. Therefore, comments can be inserted without any additional command line options. By the way, comment insertion is slower than `suppress-eslint-errors` because, unlike `suppress-eslint-errors`, it cannot modify files in parallel. However, this limitation may be improved when ESLint supports parallel processing in the near future.\n","funding_links":["https://github.com/sponsors/mizdra"],"categories":["TypeScript","Tools"],"sub_categories":["Testing Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizdra%2Feslint-interactive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmizdra%2Feslint-interactive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizdra%2Feslint-interactive/lists"}