
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
eslint-plugin-diff
Advanced tools
You've got changes, we've got checks. Run ESLint on your modified lines only.
Imagine a world where your developers receive feedback that's laser-focused on the changes they've made. Traditional setups can't offer this. But with our plugin, you can run ESLint on your changed lines only. This means all warnings and errors are directly relevant to you, saving you from drowning in a sea of linter errors.
Updating your linter or its dependencies can trigger a flood of new linter warnings and errors. Fixing them all can skyrocket your project costs. But with our plugin, you can run ESLint on only the changed lines of your code. This means new errors won't pop up in code that other developers have already reviewed and approved.
A healthy, high-quality code-base is the fuel for high velocity. But too many errors in your linter's output can slow you down. Our plugin ensures your linter runs on only the changed lines of your code. This keeps your developers from feeling overwhelmed, your code-base healthy, and your team productive.
Developers are constantly bombarded with errors and notifications. If a linter has too much output, it can be hard to tell if their changes caused an issue or if it's just old code. With our plugin, all the linter output your developers see will be related to their changes, making it easier to focus on the task at hand.
When creating pull-requests, this plugin enables you to run ESLint on only the changed lines. This sharpens the focus of your code review and reduces the time spent on it, while still maintaining a high-quality code base.
As a bonus, introducing new ESLint rules (or updating 3rd party configs) in a large codebase becomes a breeze, because you avoid getting blocked by new ESLint issues in already-approved code.
Get the plugin and extend your ESLint config.
npm install --save-dev eslint eslint-plugin-diff
yarn add -D eslint eslint-plugin-diff
pnpm add -D eslint eslint-plugin-diff
Extend your ESLint config with one of our configs.
"plugin:diff/diff"
(recommended)Only lint changes
{
"extends": ["plugin:diff/diff"]
}
"plugin:diff/ci"
In a CI-environment, only lint changes. Locally, skip the plugin (i.e. lint everything).
NOTE: This requires the environment variable
CI
to be defined, which most CI-providers set automatically.
{
"extends": ["plugin:diff/ci"]
}
"plugin:diff/staged"
Only lint the changes you've staged for an upcoming commit.
{
"extends": ["plugin:diff/staged"]
}
To lint all the changes of a pull-request, you only have to set
ESLINT_PLUGIN_DIFF_COMMIT
before running ESLint.
name: Run ESLint on your changes only
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install modules
run: npm install
- name: Fetch the base branch, so we can use `git diff`
run: git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }}
- name: Run ESLint on your changes only
env:
ESLINT_PLUGIN_DIFF_COMMIT: ${{ github.event.pull_request.base.ref }}
run: npx --no-install eslint --ext .js,.jsx,.ts,.tsx .
export ESLINT_PLUGIN_DIFF_COMMIT="origin/$BITBUCKET_PR_DESTINATION_BRANCH";
npx --no-install eslint --ext .js,.ts,.tsx .
ESLINT_PLUGIN_DIFF_COMMIT
. See git's official documentation on the syntax"plugin:diff/diff"
) or staged changes only (using "plugin:diff/staged"
)."plugin:diff/diff"
, which is equivalent to running git diff HEAD
."plugin:diff/staged"
is equivalent to running git diff HEAD --staged
FAQs
Run ESLint on your changes only
The npm package eslint-plugin-diff receives a total of 120,954 weekly downloads. As such, eslint-plugin-diff popularity was classified as popular.
We found that eslint-plugin-diff demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.