eslint-nibble
raw JSON → 9.1.1 verified Sat Apr 25 auth: no javascript
eslint-nibble is an interactive ESLint wrapper that lets you fix linting errors one rule at a time, making it easier to adopt ESLint in large codebases. Version 9.1.1 supports ESLint 7, 8, and 9, with Node >=18. Unlike mass autofix, it lets you selectively apply fixes per rule, providing a focused workflow. It uses eslint-stats for rule overview and a friendly formatter for detailed errors. No bundled ESLint; uses your project's existing ESLint installation.
Common errors
error Cannot find module 'eslint' ↓
cause eslint is not installed as a peer dependency.
fix
Install eslint: npm install --save-dev eslint
error Error: No files matching 'src/**' were found. (eslint-nibble) ↓
cause The glob pattern doesn't match any files.
fix
Verify the path or use a broader glob (e.g., src/ instead of src/**).
error TypeError: (0 , nibble_1.fixNibbles) is not a function ↓
cause Using CommonJS require instead of ESM import.
fix
Switch to ESM: use import { fixNibbles } from 'eslint-nibble' or set type:"module" in package.json.
Warnings
breaking Node >=18 required as of v9.0; drops support for Node 12-16. ↓
fix Upgrade Node.js to version 18 or higher.
breaking ESLint 6 and below no longer supported as of v8.0; use v7 of eslint-nibble if you need older ESLint. ↓
fix Remove old ESLint and install ESLint 7, 8, or 9.
deprecated The --ext option no longer defaults to .js as of v9.0; must specify explicitly for ESLint <9. ↓
fix Use --ext .js,.jsx or migrate to ESLint 9 where --ext is removed.
gotcha Programmatic API changed in v8.0.2: 'nibble' is deprecated, use 'fixNibbles' instead. ↓
fix Replace imports of 'nibble' with 'fixNibbles'.
gotcha eslint-nibble does not bundle ESLint; you must install eslint separately. ↓
fix Run 'npm install --save-dev eslint' in your project.
Install
npm install eslint-nibble yarn add eslint-nibble pnpm add eslint-nibble Imports
- default (CLI) wrong
npm run nibble -- --fix (overwrites files without prompting)correctnpx eslint-nibble src/ - fixNibbles wrong
const fixNibbles = require('eslint-nibble');correctimport { fixNibbles } from 'eslint-nibble'; - nibble (deprecated) wrong
const { nibble } = require('eslint-nibble');correctimport { nibble } from 'eslint-nibble';
Quickstart
// First, ensure eslint is installed in your project
// npm install --save-dev eslint eslint-nibble
// Then run via npx
npx eslint-nibble src/
// Or use fixNibbles programmatically (ESM only)
import { fixNibbles } from 'eslint-nibble';
async function runNibble() {
const result = await fixNibbles({
eslintOptions: {
extensions: ['.js', '.ts'],
cache: true,
cacheLocation: '.eslintcache',
},
files: ['src/'],
});
console.log('Done!');
}
runNibble();