Registry / testing / lint-changed

lint-changed

JSON →
library0.0.0-developmentjsnpmunverified

Run linters against git-changed files (both staged and unstaged) to enforce code quality before commit. Version 0.0.0-development, based on lint-staged but differs by including modified-but-unstaged files via changed-git-files instead of staged-git-files. Supports ESLint, stylelint, and other linters for JavaScript, CSS, SCSS, and more. No active maintenance or releases beyond the initial development version. Key differentiator: lints all changed files, not just staged ones, useful for pre-commit checks.

npm install lint-changed
INSTALL
IMPORT
SIG · LINT-CHANGED
L
lint-changed
testingjavascriptv0.0.0-development
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.

lintChanged
import lintChanged from 'lint-changed'
const lintChanged = require('lint-changed')
Package is ESM-only; CommonJS require will fail

Runs ESLint on changed JS files and stylelint on changed CSS files, then logs the result.

import lintChanged from 'lint-changed'; const result = await lintChanged({ linters: { '*.js': ['eslint --fix'], '*.css': ['stylelint --fix'] }, // optional: directory to search for git repo cwd: process.cwd() }); console.log('Linting complete:', result);
lint-changed --version
Debug
Known issues
deprecatedPackage is marked as 0.0.0-development and has no stable release; consider using lint-staged instead.
fix
Switch to lint-staged for a maintained and stable alternative.
affects: 0.0.0-development
breakingPackage is ESM-only and cannot be used with CommonJS require.
fix
Use import syntax or dynamic import().
affects: >=0.0.0-development
gotchaThe package may not handle large repositories efficiently; no performance guarantees.
fix
Test with your codebase size; consider limiting file patterns.
affects: >=0.0.0-development
Errors
Common errors & fixes
TypeError: lintChanged is not a function
Used CommonJS require on an ESM-only module.
fix
Change to 'import lintChanged from 'lint-changed'' or use dynamic import.
Error: Cannot find module 'changed-git-files'
Missing peer dependency 'changed-git-files'.
fix
Install it: npm install changed-git-files --save-dev
SyntaxError: Unexpected token 'export'
Running in a CommonJS environment without transpilation.
fix
Use a bundler or Node with --experimental-modules flag.
Upgrade
Version history
0.0.0-developmentlatest on npm
Audit
Dependencies
changed-git-filesrequiredcore dependency to detect changed git files
Agent activity
2 hits · last 30 days
node
2
Resources
lint-changed — npm install lint-changed · libregistry