Skip to content

Commit

Permalink
docs: update usage instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
grvcoelho committed May 4, 2018
1 parent 713a42d commit 7b4e1f0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ filter only the errors introduced in the commit range (and nothing more).
1. Install it:

```sh
npm install lint-diff
$ npm install lint-diff
```

2. Install `eslint` and add your eslint configuration file.
Expand All @@ -34,26 +34,28 @@ filter only the errors introduced in the commit range (and nothing more).

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

## Examples

1. Lint the last 3 commits:

```sh
lint-diff HEAD~3..HEAD
$ lint-diff HEAD~3..HEAD
```

2. Lint local changes that are not yet commited (similar to what [lint-staged](https://github.com/okonet/lint-staged) do):

```sh
lint-diff HEAD
$ lint-diff HEAD
# or
$ lint-diff
```

3. Lint all commits from a build in [Travis](https://travis-ci.org):

```sh
# This environment variable will be available in any Travis build
lint-diff $TRAVIS_COMMIT_RANGE
$ lint-diff $TRAVIS_COMMIT_RANGE
```

0 comments on commit 7b4e1f0

Please sign in to comment.