eslint-interactive

raw JSON →
13.0.1 verified Sat Apr 25 auth: no javascript

eslint-interactive is a CLI tool that wraps ESLint to help fix large numbers of errors interactively, grouped by rule. Current stable version is 13.0.1, published under an Apache-2.0 license, with releases following semver. It requires Node.js ^20.19.0 || ^22.12.0 || >=24.0.0 and ESLint >=9.0.0. Unlike plain eslint --fix, it provides per-rule actions: run fix, disable per line, disable per file, convert error to warning, apply suggestions, and forcibly fix. Supports flat config only (eslint.config.js); legacy .eslintrc is dropped. Global installation is not recommended.

error Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'eslint-interactive'
cause Global install or missing local dependency.
fix
Install locally: npm i -D eslint-interactive and use npx or ./node_modules/.bin/eslint-interactive.
error Config (unnamed): Key "language"
cause Incompatible with ESLint 9.5.0+ when using older eslint-interactive (<11.0.3).
fix
Upgrade to eslint-interactive >=11.0.3.
error Error: Flat config only. Use eslint-interactive@^12 for legacy config.
cause Attempting to use eslint-interactive >=13 with .eslintrc.
fix
Migrate to flat config or downgrade to eslint-interactive@^12.
error Error: The '--no-eslintrc' option does not accept a value.
cause Boolean options do not accept =false; use --no-eslintrc flag alone.
fix
Replace --no-eslintrc=false with --no-eslintrc.
breaking Drop ESLint v8 and legacy config (.eslintrc) support.
fix Upgrade to ESLint >=9.0.0 and migrate to flat config (eslint.config.js).
breaking Boolean options no longer accept arguments (e.g. --no-eslintrc=false, --cache=false).
fix Use --no-eslintrc without a value, or omit the flag altogether.
breaking Cache disabled by default; --cache-location default changed.
fix Explicitly pass --cache if you need caching.
breaking Node.js >=18 required (v13 requires >=20.19.0).
fix Use a supported Node.js version.
deprecated Global installation is not recommended and only supported on a best-effort basis.
fix Install eslint-interactive locally as a devDependency.
gotcha Requires flat config; if using legacy .eslintrc, you must use eslint-interactive@^12.
fix Migrate to flat config or downgrade to v12 (but v12 may lack latest features).
npm install eslint-interactive
yarn add eslint-interactive
pnpm add eslint-interactive

Shows both CLI usage and programmatic API with Core class and applySuggestions method.

// Install locally
// npm i -D eslint-interactive eslint

// Run the CLI interactively on src/
// npx eslint-interactive src/

// Programmatic usage (ESM):
import { Core } from 'eslint-interactive';

const core = new Core({
  // Options matching eslint's CLI flags
  cwd: process.cwd(),
  extensions: ['.js', '.ts'],
});

// Perform a lint run interactively (opens the TUI)
await core.lint(['src/']);

// Use programmable API to apply suggestions:
const result = await core.applySuggestions(
  ['src/'],
  (problem, suggestion, metadata) => {
    // Custom logic to select suggestion
    return suggestion; // or null to skip
  },
);
console.log(`Fixed ${result.fixedCount} problems.`);