/eslint-plugin-diff

Run ESLint on your changes only

Primary LanguageTypeScriptMIT LicenseMIT

eslint-plugin-diff

Run ESLint on your changes only

What problem does it solve?

Introducing new ESLint rules (or updating 3rd party configs) in a large codebase can be tedious. This plugin allows your team to ease into new rules by only linting all new/modified code, eventually migrating to the new/updated rules.

Installation

$ yarn add -D eslint-plugin-diff

Usage

It's recommended to use "plugin:diff/staged" (see config).

Config staged — Diff staged changes only

Useful for pre-commit hooks, e.g. when running ESLint with lint-staged

Extend your config in .eslintrc:

{
  "extends": ["plugin:diff/staged"]
}

Equivalent to git diff HEAD --staged

Config diff — Diff all changes since HEAD (staged and unstaged)

Extend your config in .eslintrc:

{
  "extends": ["plugin:diff/diff"]
}

Equivalent to git diff HEAD