lint-to-the-future-eslint
raw JSON → 3.3.0 verified Sat Apr 25 auth: no javascript
A plugin for lint-to-the-future that integrates with ESLint to track and manage eslint-disable comments across projects. Current stable version is 3.3.0. Release cadence is irregular, with minor releases every few months. Key differentiators: allows incremental adoption of ESLint rules by tracking disable directives, supports both flat config (ESLint >=9) and legacy .eslintrc, and provides a remove API to clean up stale disable comments. Peer dependency on ESLint ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0. Requires Node.js >=18 since v3.0.0. Uses globby for file filtering since v3.1.0.
Common errors
error Error: Cannot find module 'lint-to-the-future-eslint' ↓
cause The package is not installed or is missing from node_modules.
fix
Run
npm install lint-to-the-future-eslint --save-dev or yarn add lint-to-the-future-eslint --dev. error TypeError: plugin is not a function ↓
cause The plugin is used incorrectly in lint-to-the-future configuration (e.g., imported as a named export instead of default).
fix
Use
import lintToTheFutureEslint from 'lint-to-the-future-eslint' or const lintToTheFutureEslint = require('lint-to-the-future-eslint'). error ESLint configuration error: 'lint-to-the-future-eslint' plugin not found ↓
cause The plugin is listed in eslint's plugins array but not installed.
fix
Install the package:
npm install lint-to-the-future-eslint --save-dev and ensure it's added to eslint's plugins. error Error [ERR_REQUIRE_ESM]: require() of ES Module not supported ↓
cause Using CommonJS require() to load the package which is ESM-only in newer versions.
fix
Either use dynamic import() or switch to ESM for your project: add
"type": "module" to package.json and use import syntax. Warnings
breaking Version 3.0.0 drops support for Node.js <18 and ESLint 7. Ensure your runtime is Node >=18 and ESLint >=8. ↓
fix Upgrade Node.js to >=18 and ESLint to ^8.0.0 || ^9.0.0.
deprecated ESLint legacy .eslintrc format is still supported but may be removed in a future major version. Flat config is preferred. ↓
fix Migrate to ESLint flat config (eslint.config.js) for forward compatibility.
gotcha The plugin only processes eslint-disable comments. Other disable directives like eslint-disable-next-line are not tracked unless they span multiple lines. ↓
fix Ensure your disable comments are formatted as eslint-disable blocks to be detected.
gotcha File filtering uses globby since v3.1.0. Custom file patterns may need adjustment if you were relying on previous filtering behavior. ↓
fix Review your lint-to-the-future configuration's files glob pattern.
gotcha The plugin does not support ESLint's --no-inline-config flag; inline disable comments are always considered. ↓
fix If you need to ignore disable comments, use a custom ESLint configuration that overrides noInlineConfig.
Install
npm install lint-to-the-future-eslint yarn add lint-to-the-future-eslint pnpm add lint-to-the-future-eslint Imports
- default (plugin object) wrong
const { LintToTheFutureEslint } = require('lint-to-the-future-eslint')correctimport lintToTheFutureEslint from 'lint-to-the-future-eslint' - Plugin (TypeScript type)
import type { Plugin } from 'lint-to-the-future-eslint'
Quickstart
// Add lint-to-the-future-eslint to your lint-to-the-future configuration
// .lint-to-the-future.json
{
"plugins": ["lint-to-the-future-eslint"],
"files": ["src/**/*.js", "src/**/*.ts", "src/**/*.gjs", "src/**/*.gts"],
"eslint": {}
}
// Run lint-to-the-future to generate report
// npx lint-to-the-future build
// Example programmatic usage
import lintToTheFutureEslint from 'lint-to-the-future-eslint';
const result = await lintToTheFutureEslint({
cwd: process.cwd(),
globs: ['src/**/*.js'],
eslintOptions: { overrideConfig: { rules: { 'no-console': 'warn' } } }
});
console.log(result); // { files: [...], stats: { total: 10, disabled: 3 } }