{"id":20000,"library":"eslint-seatbelt","title":"eslint-seatbelt","description":"eslint-seatbelt is an ESLint plugin that enables gradual tightening of lint rules via a ratcheting mechanism. It stores per-file error counts in a TSV file and automatically updates them on each lint run, preventing new violations while allowing existing ones to be fixed over time. Version 0.1.3 is current, with stable APIs for both ESLint 7 (legacy) and 8+ (flat config). Unlike bulk suppression tools that use JSON/YAML (merge conflicts) or require wrappers, eslint-seatbelt uses the ESLint processor API for seamless editor/CI integration. Reimplements an internal Notion tool used for large-scale rule migrations. Ships TypeScript types.","status":"active","version":"0.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/justjake/eslint-seatbelt","tags":["javascript","eslint","incremental","gradual","workflow","processor","linting","typescript"],"install":[{"cmd":"npm install eslint-seatbelt","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-seatbelt","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-seatbelt","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: required as plugin host engine","package":"eslint","optional":false},{"reason":"peer dependency: TypeScript types for ESLint integration","package":"@types/eslint","optional":true}],"imports":[{"note":"ESM-only since v0.1.0; CJS require() will fail unless using ESM interop. Default export is the plugin object.","wrong":"const seatbelt = require('eslint-seatbelt')","symbol":"default","correct":"import seatbelt from 'eslint-seatbelt'"},{"note":"processors is a sub-object of the default export. Named export 'processors' does not exist.","wrong":"import { processors } from 'eslint-seatbelt'","symbol":"seatbelt.processors.seatbelt","correct":"import seatbelt from 'eslint-seatbelt'; seatbelt.processors.seatbelt"},{"note":"Use in flat config array. Equivalent to manually setting plugin, rule, and processor.","symbol":"seatbelt.configs.enable","correct":"import seatbelt from 'eslint-seatbelt'; seatbelt.configs.enable"},{"note":"Legacy configs are only accessible via string extend in eslintrc; no direct JS import.","wrong":"import { enableLegacy } from 'eslint-seatbelt'","symbol":"seatbelt.configs.enable-legacy","correct":"plugin:eslint-seatbelt/enable-legacy (in eslintrc extend)"}],"quickstart":{"code":"// File: eslint.config.mjs\nimport seatbelt from 'eslint-seatbelt'\nimport js from '@eslint/js'\n\nexport default [\n  js.configs.recommended,\n  seatbelt.configs.enable,\n  {\n    rules: {\n      'no-unused-vars': 'error'\n    }\n  }\n]\n// Then run: SEATBELT_INCREASE=no-unused-vars npx eslint .\n// This creates eslint.seatbelt.tsv with current error counts.\n// Subsequent runs will fail if new errors are introduced.","lang":"typescript","description":"Sets up eslint-seatbelt with flat config, then runs SEATBELT_INCREASE to ratchet a new rule."},"warnings":[{"fix":"Use npm add eslint-plugin-eslint-seatbelt@npm:eslint-seatbelt --save-dev when using ESLint <=7. This aliases package to satisfy plugin naming convention.","message":"ESLint 7 users must install with npm alias: eslint-plugin-eslint-seatbelt@npm:eslint-seatbelt","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Set all rules you want to enforce via seatbelt to 'error' severity. Warnings are not tracked and will not prevent regressions.","message":"Rules configured as 'warning' are ignored by eslint-seatbelt; only 'error' severity is ratcheted.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Always commit eslint.seatbelt.tsv. In CI, run with SEATBELT_FROZEN=1 or CI=1 to verify file is up-to-date.","message":"Seatbelt file (eslint.seatbelt.tsv) must be committed to version control and kept in sync with codebase.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Avoid parallel linting across files; run a single ESLint pass to ensure atomic updates to the TSV file.","message":"Running multiple ESLint instances in parallel (e.g., lint-staged) may produce inconsistent seatbelt file","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":"Use seatbelt.configs.enable which sets processor correctly, or manually: processor: seatbelt.processors.seatbelt","cause":"Using processor in flat config incorrectly (processor is a string, not object).","error":"Error: ESLint configuration in eslint.config.mjs is invalid: The value \"eslint-seatbelt\" for the \"processor\" setting must be a string."},{"fix":"Run: npm add eslint-plugin-eslint-seatbelt@npm:eslint-seatbelt --save-dev","cause":"Missing or incorrect npm install command for ESLint 7 (alias required).","error":"Parsing error: Cannot find module 'eslint-seatbelt'"},{"fix":"Use [ seatbelt.configs.enable ] or spread: ...seatbelt.configs.enable is incorrect; just object reference.","cause":"Using seatbelt.configs.enable() instead of seatbelt.configs.enable (it's an object, not a factory).","error":"TypeError: seatbelt.configs.enable is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}