All Projects → paleite → eslint-plugin-diff

paleite / eslint-plugin-diff

Licence: MIT license
Run ESLint on your changes only

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to eslint-plugin-diff

Diff.Net
A differencing utility for Window desktop written in C#.
Stars: ✭ 34 (-57.5%)
Mutual labels:  diff
eslint-plugin-header
ESLint plugin to ensure that files begin with given comment
Stars: ✭ 65 (-18.75%)
Mutual labels:  eslint-plugin
duff
Pure OCaml implementation of libXdiff (Rabin's fingerprint)
Stars: ✭ 20 (-75%)
Mutual labels:  diff
eslint-plugin-array-func
Rules for Array functions and methods.
Stars: ✭ 77 (-3.75%)
Mutual labels:  eslint-plugin
gitdub
📤 A github WebHook that emails detailed diffs of your commits.
Stars: ✭ 25 (-68.75%)
Mutual labels:  diff
ngx-text-diff
A Text Diff component for Angular
Stars: ✭ 49 (-38.75%)
Mutual labels:  diff
dipa
dipa makes it easy to efficiently delta encode large Rust data structures.
Stars: ✭ 243 (+203.75%)
Mutual labels:  diff
speech-recognition-evaluation
Evaluate results from ASR/Speech-to-Text quickly
Stars: ✭ 25 (-68.75%)
Mutual labels:  diff
eslint-plugin-strict-dependencies
ESlint plugin to define custom module dependency rules.
Stars: ✭ 142 (+77.5%)
Mutual labels:  eslint-plugin
eslint-plugin-import-access
www.npmjs.com/package/eslint-plugin-import-access
Stars: ✭ 204 (+155%)
Mutual labels:  eslint-plugin
diffhtml
Tools for generating diff output in HTML.
Stars: ✭ 23 (-71.25%)
Mutual labels:  diff
tqsdk-js
期货行情/历史数据/交易 开发包
Stars: ✭ 52 (-35%)
Mutual labels:  diff
dif
'dif' is a Linux preprocessing front end to gvimdiff/meld/kompare
Stars: ✭ 18 (-77.5%)
Mutual labels:  diff
fast diff match patch
Python package for Google's diff-match-patch native C++ implementation.
Stars: ✭ 55 (-31.25%)
Mutual labels:  diff
Odin
manage model revisions with ease
Stars: ✭ 60 (-25%)
Mutual labels:  diff
diff-text
Just get the diff of a simple inline text, simple mode.
Stars: ✭ 13 (-83.75%)
Mutual labels:  diff
textdiff-create
Create lean text diff deltas.
Stars: ✭ 25 (-68.75%)
Mutual labels:  diff
spotdiff.vim
A range and area selectable diffthis to compare partially
Stars: ✭ 29 (-63.75%)
Mutual labels:  diff
react-rich-diff
React component to render rich diff between two documents (Markdown, HTML)
Stars: ✭ 51 (-36.25%)
Mutual labels:  diff
lightline-gitdiff
Show added, deleted and modified lines (`git diff`) in your statusline or lightline
Stars: ✭ 27 (-66.25%)
Mutual labels:  diff

eslint-plugin-diff

codecov

Run ESLint on your changed lines only.

What problem does it solve?

The feedback your developers get in a pull-request should be focused on the changes they've made, but traditional setups don't allow for this. With this plugin you can run ESLint on your changed lines only, making all warnings and errors relevant to you, and at the same time avoiding becoming overwhelmed with linter errors.

💰 Your company's budget is precious

When updating your linter or its dependencies, you often get new linter warnings and errors in your code, which can lead to a huge increase of the cost of your project if you try to fix all of them. This plugin allows you to run ESLint on only the changed lines of your code, so the new errors won't get triggered on the code other developers have already manually reviewed and approved.

🚀 Your team's velocity is important

Having a healthy and high-quality code-base is a pre-requisite for high velocity and having too many errors in your linter's output can get overwhelming, oftentimes disheartening the developers, at the cost of the quality of the code. Having a linter that runs on only the changed lines of your code will ensure your developers don't get overwhelmed, ensuring your code-base will remain healthy, and your team productive.

🧠 Your developers' focus is vital

Let's face it – Developers are bombarded with errors and notifications about systems being broken, code being wrong and people requiring their attention. If a linter has too much output, it becomes a chore for your developers just to assess whether or not their changes actually caused an issue, or if it's just old code they haven't even touched. With this plugin, all the linter output your developers see will be related to whatever they have personally changed, requiring much less focus on parsing the linter's output.

How does it solve it?

When creating pull-requests, this plugin will enable you to run ESLint on only the changed lines of your pull-request, increasing the focus of your code review. This is a great way to reduce the amount of time spent on code review while still maintaining a high quality code base and increase the quality of your feedback.

As an added bonus, it also makes introducing new ESLint rules (or updating 3rd party configs) in a large codebase trivial, because you avoid becoming blocked by new ESLint issues in already-approved code.

Installation

Install the plugin and extend your ESLint config.

Install

yarn add -D eslint eslint-plugin-diff

Extend config

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"]
}

Enable the plugin in CI only

If you want to enable the plugin in CI only, you can use extend the config with the the plugin locally, but enable it

CI Setup

To lint all the changes of a pull-request, you only have to set ESLINT_PLUGIN_DIFF_COMMIT before running ESLint.

For GitHub Actions

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 .

For BitBucket Pipelines

export ESLINT_PLUGIN_DIFF_COMMIT="origin/$BITBUCKET_PR_DESTINATION_BRANCH";
npx --no-install eslint --ext .js,.ts,.tsx .

Note

  • You can use any valid commit syntax for ESLINT_PLUGIN_DIFF_COMMIT. See git's official documentation on the syntax
  • You can choose to lint all changes (using "plugin:diff/diff") or staged changes only (using "plugin:diff/staged").
  • We recommend using "plugin:diff/diff", which is equivalent to running git diff HEAD.
  • "plugin:diff/staged" is equivalent to running git diff HEAD --staged
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].