• Stars
    star
    114
  • Rank 306,316 (Top 7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ’… Run eslint only in the changed parts of the code

lint-diff

Build Status

๐Ÿ’… Run eslint only in the changed parts of the code

Why

ESLint is a great tool to enforce code style in your code, but it has some limitations: it can only lint entire files. When working with legacy code, we often have to make changes to very large files (which would be too troublesome to fix all lint errors)and thus it would be good to lint only the lines changed and not the entire file.

lint-diff receives a commit range and uses ESLint to lint the changed files and filter only the errors introduced in the commit range (and nothing more).

State of the art

  • lint-staged is a similar tool that lints only the staged changes. It's very helpful for adding a precommit hook, but it cannot be used to enforce the styleguide on a Continuous Integration service like Travis, because the changes are already commited.

Usage

  1. Install it:
$ npm install lint-diff
  1. Install eslint and add your eslint configuration file.

  2. Use it:

# This will lint the last commit
$ lint-diff HEAD^..HEAD

Examples

  1. Lint the last 3 commits:
$ lint-diff HEAD~3..HEAD
  1. Lint local changes that are not yet commited (similar to what lint-staged do):
$ lint-diff HEAD
# or
$ lint-diff
  1. Lint all commits from a build in Travis:
# This environment variable will be available in any Travis build
$ lint-diff $TRAVIS_COMMIT_RANGE

More Repositories

1

css-styleguide

๐Ÿ“– Opinionated CSS styleguide for scalable applications
413
star
2

react-voice-components

Set of React components that use the Web Speech API to bring voice experience to React applications
JavaScript
194
star
3

arturia

๐ŸŽน arturia - a fully functional recreation of Arturia's MiniLab 3 MIDI controller made with CSS and JavaScript
TypeScript
108
star
4

vim-javascript-snippets

๐Ÿ”ง JavaScript & NodeJS Snippets for Vim
67
star
5

silverplate

๐ŸŒ Front-end boilerplate with Webpack, Hot Reload, Tree-Shaking and React
JavaScript
64
star
6

babelfish

๐Ÿก Straightforward library for translations and dictionaries
JavaScript
47
star
7

payment-request

๐Ÿ’ธ Implementation of Payment Request Api using pagarme
JavaScript
17
star
8

169254

๐Ÿ“Ÿ A simple API that simulate AWS EC2's metadata endpoint
Go
16
star
9

talks

โšก Lightning Talks
8
star
10

dotfiles

๐Ÿ”ง General-purpose dotfiles for terraforming your brand-new OS.
Shell
7
star
11

nosce

๐Ÿ“ฏ Get metadata information of your EC2 instances
Go
6
star
12

pagarme-github-challenge

๐Ÿ‘ทThis was a challenge I did in 2015 to be part of Pagar.me's Front-end Team
JavaScript
5
star
13

lando

โ˜„๏ธ Functional library utility for modern javascript
JavaScript
4
star
14

stripe

๐Ÿ’ธ Stripe's Checkout in React
JavaScript
4
star
15

wifi-password

Get your wifi's password in Fish Shell
Shell
3
star
16

vault

๐Ÿฆ Manage credentials securely using AWS KMS and AWS DynamoDB
2
star
17

dungeon

๐Ÿ‰ An attempt at a dungeon rogue-like deck game
Reason
2
star
18

react-deckset

๐Ÿ“ฐ Create beautiful presentations written in markdown
1
star
19

hackerrank

๐Ÿ“€ h4ck1ng ๐Ÿ“€
Go
1
star
20

brastemp

๐Ÿ“ฆ Proof-of-concept of a cluster infrastructure to deploy containers in the cloud.
HCL
1
star
21

hashi

๐Ÿ“Ÿ Proof-of-concept of a Hashicorp cluster infrastructure (Terraform, Consul, Nomad and Packer)
1
star
22

webhulk

๐Ÿ’ช A lightweight API for managing webhooks
Go
1
star