{"id":26950,"library":"eslint-baseline","title":"eslint-baseline","description":"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.","status":"active","version":"0.4.0","language":"javascript","source_language":"en","source_url":"https://github.com/lukahartwig/eslint-baseline","tags":["javascript","baseline","ci","cli","code","continuous integration","eslint","linter","quality"],"install":[{"cmd":"npm install eslint-baseline","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-baseline","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-baseline","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency - eslint-baseline wraps ESLint and requires it to run linting","package":"eslint","optional":true}],"imports":[{"note":"eslint-baseline is a CLI tool, not a library. Use via npx or as a script in package.json.","symbol":"cli","correct":"npx eslint-baseline"},{"note":"ESM-only since v0.1.0; no CommonJS support.","wrong":"const eslintBaseline = require('eslint-baseline')","symbol":"default","correct":"import eslintBaseline from 'eslint-baseline'"},{"note":"Named export for programmatic use; not commonly used.","wrong":"","symbol":"ESLintBaseline","correct":"import { ESLintBaseline } from 'eslint-baseline'"}],"quickstart":{"code":"npm install --save-dev eslint eslint-baseline\nnpx eslint-baseline --init\necho \"Add lint scripts to package.json:\"\necho '\"scripts\": { \"lint\": \"eslint-baseline .\", \"lint:update-baseline\": \"eslint-baseline --update-baseline .\" }'\nnpm run lint\n# Creates .eslint-baseline.json; subsequent runs only show new errors\nnpm run lint:update-baseline\n# Updates baseline to include new errors","lang":"typescript","description":"Demonstrates installing eslint-baseline, initializing a baseline, configuring package.json scripts, and running lint with baseline update."},"warnings":[{"fix":"Run eslint-baseline --update-baseline to regenerate baseline file.","message":"v0.3.0 introduced hash-based error identification; location-based baseline files from older versions are incompatible.","severity":"breaking","affected_versions":"<0.3.0"},{"fix":"Update to latest version and regenerate baseline.","message":"Location-based error identification deprecated in favor of hash-based approach since v0.3.2.","severity":"deprecated","affected_versions":"<0.3.2"},{"fix":"Run eslint-baseline --update-baseline after editing files to refresh baseline.","message":"Editing files with existing errors may shift error locations, causing them to appear as new errors until baseline is updated.","severity":"gotcha","affected_versions":"*"},{"fix":"Pin exact version and test updates.","message":"Programmatic API is not stable; breaking changes may occur without major version bump.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install --save-dev eslint` (eslint is a peer dependency).","cause":"eslint is not installed or not in node_modules.","error":"Error: Cannot find module 'eslint'"},{"fix":"Install the missing plugin, e.g., `npm install --save-dev eslint-plugin-react`.","cause":"A required ESLint plugin is missing.","error":"Error: Failed to load plugin 'xxx' declared in '.eslintrc'"},{"fix":"Check ESLint documentation for valid config properties; fix the config.","cause":"Invalid ESLint config file (e.g., .eslintrc.json).","error":"Error: ESLint configuration is invalid: Unexpected top-level property \"xxx\""},{"fix":"Run `npx eslint-baseline --init` or `npx eslint-baseline --update-baseline`.","cause":"Baseline file not found; likely first run without --init or --update-baseline.","error":"Error: ENOENT: no such file or directory, open '.eslint-baseline.json'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}