PHPackages                             automattic/eslint-changed - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. automattic/eslint-changed

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

automattic/eslint-changed
=========================

description

v2.1.6(2mo ago)41.3k↑25%1GPL-2.0-or-laterJavaScriptCI failing

Since Aug 13Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/Automattic/eslint-changed)[ Packagist](https://packagist.org/packages/automattic/eslint-changed)[ RSS](/packages/automattic-eslint-changed/feed)WikiDiscussions trunk Synced 1mo ago

READMEChangelogDependencies (1)Versions (23)Used By (0)

ESLint Changed
==============

[](#eslint-changed)

Run [ESLint](https://www.npmjs.com/package/eslint) on files and only report new warnings and errors.

Installation
------------

[](#installation)

Install via your favorite JS package manager. Note the peer dependency on eslint.

For example,

```
npm install @automattic/eslint-changed eslint

```

Usage
-----

[](#usage)

To identify the changes, `eslint-changed` needs the ESLint output for both the old and new versions of the file, as well as the diff between them. If you use git, it can determine this automatically. Otherwise, you can supply the necessary information manually.

Options used in both modes are:

- `--debug`: Enable debug output.
- `--ext `: Comma-separated list of JavaScript file extensions. Ignored if files are listed. (default: ".js")
- `--format `: ESLint format to use for output. (default: "stylish")
- `--in-diff-only`: Only include messages on lines changed in the diff. This may miss things like deleting a `var` that leads to a new `no-undef` elsewhere.

### Manual diff

[](#manual-diff)

The following options are used with manual mode:

- `--diff `: A file containing the unified diff of the changes.
- `--diff-base `: Base directory the diff is relative to. Defaults to the current directory.
- `--eslint-orig `: A file containing the JSON output of eslint on the unchanged files.
- `--eslint-new `: A file containing the JSON output of eslint on the changed files.

### With git

[](#with-git)

In git mode, `eslint-changed` needs to be able to run `git`. If this is not available by that name in the shell path, set environment variable `GIT` as appropriate.

The following options are used with git mode:

- `--git`: Signify that you're using git mode.
- `--git-staged`: Compare the staged version to the HEAD version (this is the default).
- `--git-unstaged`: Compare the working copy version to the staged (or HEAD) version.
- `--git-base `: Compare the HEAD version to the HEAD of a different base (e.g. branch).
- `--eslint-options `: Pass additional options for ESLint. Value is interpreted as JSON if possible, otherwise it's treated as a literal string. See  (or the equivalent for the version of eslint in use) for details on available options.

Examples
--------

[](#examples)

This will compare the staged changes with HEAD.

```
npx @automattic/eslint-changed --git
```

This will compare HEAD with origin/trunk.

```
npx @automattic/eslint-changed --git --git-base origin/trunk
```

This does much the same as the previous example, but manually. If you're using something other than git, you might do something like this.

```
# Produce a diff.
git diff origin/trunk...HEAD > /tmp/diff

# Check out the merge-base of origin/trunk and HEAD.
git checkout origin/trunk...HEAD

# Run ESLint.
npx eslint --format=json . > /tmp/eslint.orig.json

# Go back to HEAD.
git checkout -

# Run ESLint again.
npx eslint --format=json . > /tmp/eslint.new.json

# Run eslint-changed.
npx @automattic/eslint-changed --diff /tmp/diff --eslint-orig /tmp/eslint.orig.json --eslint=new /tmp/eslint.new.json
```

Note that, to be exactly the same as the above, you'd want to extract the list of files from the diff instead of linting everything. But this will work.

This will compare file.js in HEAD with origin/trunk, with the equivalent of passing `--flag v10_config_lookup_from_file` to `eslint`.

```
npx @automattic/eslint-changed --git --git-base origin/trunk --eslint-options flags='["v10_config_lookup_from_file"]' -- file.js
```

Inspiration
-----------

[](#inspiration)

We had been using [phpcs-changed](https://packagist.org/packages/sirbrillig/phpcs-changed) for a while, and wanted the same thing for ESLint.

###  Health Score

53

—

FairBetter than 96% of packages

Maintenance93

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 54.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~97 days

Recently: every ~50 days

Total

18

Last Release

74d ago

Major Versions

v1.0.1 → v2.0.02021-12-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c5869ecbb8e0eac7e8b8e0f3cf7bdd8d5fcdc4abc10a72281872c53f8639d44?d=identicon)[automattic](/maintainers/automattic)

![](https://www.gravatar.com/avatar/11609890f6e7a840715f4cfc9622d77ea64b7dfc024df5643fbf8471a18c00f3?d=identicon)[kraft](/maintainers/kraft)

![](https://www.gravatar.com/avatar/5326730499ec14e274f51b9bcc39db6aac0fb38b33849715aae0e2587a2b93df?d=identicon)[jeherve](/maintainers/jeherve)

![](https://www.gravatar.com/avatar/6e220e167e341c28b1aa10bf0bb0374999068329f8683d3187ee3cf6749b8837?d=identicon)[dereksmart](/maintainers/dereksmart)

---

Top Contributors

[![anomiex](https://avatars.githubusercontent.com/u/1030580?v=4)](https://github.com/anomiex "anomiex (109 commits)")[![tbradsha](https://avatars.githubusercontent.com/u/32492176?v=4)](https://github.com/tbradsha "tbradsha (29 commits)")[![samiff](https://avatars.githubusercontent.com/u/15803018?v=4)](https://github.com/samiff "samiff (9 commits)")[![jeherve](https://avatars.githubusercontent.com/u/426388?v=4)](https://github.com/jeherve "jeherve (8 commits)")[![zinigor](https://avatars.githubusercontent.com/u/374293?v=4)](https://github.com/zinigor "zinigor (7 commits)")[![sdixon194](https://avatars.githubusercontent.com/u/33553323?v=4)](https://github.com/sdixon194 "sdixon194 (5 commits)")[![coder-karen](https://avatars.githubusercontent.com/u/16754605?v=4)](https://github.com/coder-karen "coder-karen (4 commits)")[![gmjuhasz](https://avatars.githubusercontent.com/u/36671565?v=4)](https://github.com/gmjuhasz "gmjuhasz (3 commits)")[![manzoorwanijk](https://avatars.githubusercontent.com/u/18226415?v=4)](https://github.com/manzoorwanijk "manzoorwanijk (3 commits)")[![kraftbj](https://avatars.githubusercontent.com/u/88897?v=4)](https://github.com/kraftbj "kraftbj (2 commits)")[![ice9js](https://avatars.githubusercontent.com/u/8056203?v=4)](https://github.com/ice9js "ice9js (2 commits)")[![sergeymitr](https://avatars.githubusercontent.com/u/1341249?v=4)](https://github.com/sergeymitr "sergeymitr (2 commits)")[![Initsogar](https://avatars.githubusercontent.com/u/1488641?v=4)](https://github.com/Initsogar "Initsogar (1 commits)")[![guarani](https://avatars.githubusercontent.com/u/1898325?v=4)](https://github.com/guarani "guarani (1 commits)")[![adamwoodnz](https://avatars.githubusercontent.com/u/1017872?v=4)](https://github.com/adamwoodnz "adamwoodnz (1 commits)")[![gogdzl](https://avatars.githubusercontent.com/u/37049295?v=4)](https://github.com/gogdzl "gogdzl (1 commits)")[![millerf](https://avatars.githubusercontent.com/u/790558?v=4)](https://github.com/millerf "millerf (1 commits)")[![nunyvega](https://avatars.githubusercontent.com/u/16329583?v=4)](https://github.com/nunyvega "nunyvega (1 commits)")[![paulopmt1](https://avatars.githubusercontent.com/u/1044309?v=4)](https://github.com/paulopmt1 "paulopmt1 (1 commits)")[![psealock](https://avatars.githubusercontent.com/u/1922453?v=4)](https://github.com/psealock "psealock (1 commits)")

---

Tags

eslintnpm-modulenpm-package

### Embed Badge

![Health badge](/badges/automattic-eslint-changed/health.svg)

```
[![Health](https://phpackages.com/badges/automattic-eslint-changed/health.svg)](https://phpackages.com/packages/automattic-eslint-changed)
```

###  Alternatives

[symfony/polyfill-uuid

Symfony polyfill for uuid functions

688335.4M63](/packages/symfony-polyfill-uuid)[spatie/error-solutions

This is my package error-solutions

6853.2M11](/packages/spatie-error-solutions)[phpflo/phpflo

Flow-based programming for PHP

2173.3k4](/packages/phpflo-phpflo)[eftec/autoloadone

AutoloadOne is a program that generates an autoload class for PHP.

403.4k](/packages/eftec-autoloadone)[ys-tools/default-theme-configuration-bundle

OroCommerce Default Theme Configuration Bundle

124.2k](/packages/ys-tools-default-theme-configuration-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
