Skip to content

Commit

Permalink
project: rename to lint-diff
Browse files Browse the repository at this point in the history
  • Loading branch information
grvcoelho committed Apr 13, 2018
1 parent 7e811b5 commit 27c8819
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# difflint
# lint-diff

[![Build Status](https://travis-ci.org/grvcoelho/difflint.svg?branch=master)](https://travis-ci.org/grvcoelho/difflint)
[![Build Status](https://travis-ci.org/grvcoelho/lint-diff.svg?branch=master)](https://travis-ci.org/grvcoelho/lint-diff)

:nail_care: Run eslint only in the changed parts of the code

Expand All @@ -12,7 +12,7 @@ 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.

[difflint](https://github.com/grvcoelho/difflint) receives a commit range and
[lint-diff](https://github.com/grvcoelho/lint-diff) receives a commit range and
uses [ESLint](https://github.com/eslint/eslint) to lint the changed files and
filter only the errors introduced in the commit range (and nothing more).

Expand All @@ -25,7 +25,7 @@ filter only the errors introduced in the commit range (and nothing more).
1. Install it:

```sh
npm install difflint
npm install @grvcoelho/lint-diff
```

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

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

## Examples

1. Lint the last 3 commits:

```sh
difflint lint HEAD~3..HEAD
lint-diff lint 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
difflint lint HEAD
lint-diff lint HEAD
```

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

```sh
# This environment variable will be available in any Travis build
difflint lint $TRAVIS_COMMIT_RANGE
lint-diff lint $TRAVIS_COMMIT_RANGE
```
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "difflint",
"version": "0.3.0",
"name": "@grvcoelho/lint-diff",
"version": "0.5.0",
"description": ":nail_care: Run eslint only in the changed parts of the code",
"main": "./dist/difflint.js",
"bin": "./dist/difflint.js",
"main": "./dist/lint-diff.js",
"bin": "./dist/lint-diff.js",
"scripts": {
"build": "webpack",
"lint": "eslint 'src/**/*.js'",
Expand All @@ -12,7 +12,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/grvcoelho/difflint.git"
"url": "git+https://github.com/grvcoelho/lint-diff.git"
},
"keywords": [
"linter",
Expand All @@ -23,9 +23,9 @@
"author": "Guilherme Coelho <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/grvcoelho/difflint/issues"
"url": "https://github.com/grvcoelho/lint-diff/issues"
},
"homepage": "https://github.com/grvcoelho/difflint#readme",
"homepage": "https://github.com/grvcoelho/lint-diff#readme",
"devDependencies": {
"babel-loader": "^7.1.4",
"babel-plugin-add-module-exports": "^0.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import program from 'commander'
import run from './difflint'
import run from './lint-diff'

program
.command('lint <commit-range>')
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const config = {
output: {
path: path.join(__dirname, './dist'),
libraryTarget: 'commonjs2',
filename: 'difflint.js',
sourceMapFilename: 'difflint.js.map',
filename: 'lint-diff.js',
sourceMapFilename: 'lint-diff.js.map',
},
devtool: 'source-map',
target: 'node',
Expand Down

0 comments on commit 27c8819

Please sign in to comment.