Registry / testing / eslint-baseline

eslint-baseline

JSON →
library0.4.0jsnpmunverified

eslint-baseline (v0.4.0) is a tool to run ESLint with a baseline file, allowing legacy projects to adopt linting by ignoring existing errors. It creates a `.eslint-baseline.json` file storing known violations, and subsequent runs only report new errors. Key differentiators: hash-based error identification (improved location-based detection), simple CLI workflow, and explicit baseline update command. Released November 2024 with minor features; peer dependency on ESLint 8.x. In early development with unstable APIs.

npm install eslint-baseline
INSTALL
IMPORT
SIG · ESLINT-BASELINE
E
eslint-baseline
testingjavascriptv0.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cli
npx eslint-baseline
eslint-baseline is a CLI tool, not a library. Use via npx or as a script in package.json.
default
import eslintBaseline from 'eslint-baseline'
const eslintBaseline = require('eslint-baseline')
ESM-only since v0.1.0; no CommonJS support.
ESLintBaseline
import { ESLintBaseline } from 'eslint-baseline'
Named export for programmatic use; not commonly used.

Demonstrates installing eslint-baseline, initializing a baseline, configuring package.json scripts, and running lint with baseline update.

npm install --save-dev eslint eslint-baseline npx eslint-baseline --init echo "Add lint scripts to package.json:" echo '"scripts": { "lint": "eslint-baseline .", "lint:update-baseline": "eslint-baseline --update-baseline ." }' npm run lint # Creates .eslint-baseline.json; subsequent runs only show new errors npm run lint:update-baseline # Updates baseline to include new errors
eslint-baseline --version
Debug
Known issues
breakingv0.3.0 introduced hash-based error identification; location-based baseline files from older versions are incompatible.
fix
Run eslint-baseline --update-baseline to regenerate baseline file.
affects: <0.3.0
deprecatedLocation-based error identification deprecated in favor of hash-based approach since v0.3.2.
fix
Update to latest version and regenerate baseline.
affects: <0.3.2
gotchaEditing files with existing errors may shift error locations, causing them to appear as new errors until baseline is updated.
fix
Run eslint-baseline --update-baseline after editing files to refresh baseline.
affects: *
gotchaProgrammatic API is not stable; breaking changes may occur without major version bump.
fix
Pin exact version and test updates.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint'
eslint is not installed or not in node_modules.
fix
Run `npm install --save-dev eslint` (eslint is a peer dependency).
Error: Failed to load plugin 'xxx' declared in '.eslintrc'
A required ESLint plugin is missing.
fix
Install the missing plugin, e.g., `npm install --save-dev eslint-plugin-react`.
Error: ESLint configuration is invalid: Unexpected top-level property "xxx"
Invalid ESLint config file (e.g., .eslintrc.json).
fix
Check ESLint documentation for valid config properties; fix the config.
Error: ENOENT: no such file or directory, open '.eslint-baseline.json'
Baseline file not found; likely first run without --init or --update-baseline.
fix
Run `npx eslint-baseline --init` or `npx eslint-baseline --update-baseline`.
Upgrade
Version history
0.4.0latest on npm
Audit
Dependencies
eslintoptionalpeer dependency - eslint-baseline wraps ESLint and requires it to run linting
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-baseline — npm install eslint-baseline · libregistry