From 27c8819fe6a86864b428525817119abe83e2ba81 Mon Sep 17 00:00:00 2001 From: Guilherme Rv Coelho Date: Fri, 13 Apr 2018 08:54:29 -0300 Subject: [PATCH] project: rename to lint-diff --- README.md | 16 ++++++++-------- package-lock.json | 4 ++-- package.json | 14 +++++++------- src/index.js | 2 +- src/{difflint.js => lintdiff.js} | 0 webpack.config.js | 4 ++-- 6 files changed, 20 insertions(+), 20 deletions(-) rename src/{difflint.js => lintdiff.js} (100%) diff --git a/README.md b/README.md index d3f518e..283dd31 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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). @@ -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. @@ -34,7 +34,7 @@ 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 @@ -42,18 +42,18 @@ filter only the errors introduced in the commit range (and nothing more). 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 ``` diff --git a/package-lock.json b/package-lock.json index 3aa6ada..89349cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { - "name": "difflint", - "version": "0.3.0", + "name": "@grvcoelho/lint-diff", + "version": "0.5.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 161f10a..59277de 100644 --- a/package.json +++ b/package.json @@ -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'", @@ -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", @@ -23,9 +23,9 @@ "author": "Guilherme Coelho ", "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", diff --git a/src/index.js b/src/index.js index 955cf24..2a9f353 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ import program from 'commander' -import run from './difflint' +import run from './lint-diff' program .command('lint ') diff --git a/src/difflint.js b/src/lintdiff.js similarity index 100% rename from src/difflint.js rename to src/lintdiff.js diff --git a/webpack.config.js b/webpack.config.js index 46ac538..a9876d0 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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',