lint-staged
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,6 +0,10 @@ | ||
# v1.0.1 | ||
# 1.0.2 | ||
- Fixed path resolution to the app root on Windows. #19 by <OJ Kwon> | ||
# 1.0.1 | ||
- Fixed support of local npm scripts from package.json | ||
# v1.0.0 | ||
# 1.0.0 | ||
@@ -10,9 +14,4 @@ - Complete re-write using Node.js API to fix #5, #6, #7, #8 | ||
# v0.3.0 | ||
# 0.2.2 | ||
- Added sass-lint linter (#13) | ||
- Added stylint linter (#11) | ||
# v0.2.2 | ||
- Switch to bin/bash and fix file existncy check #9 @fubhy | ||
@@ -22,7 +21,7 @@ - Switch to `$(npm bin)` instead of hardcoding path #9 @fubhy | ||
# v0.2.1 | ||
# 0.2.1 | ||
- Fixed path for flow binary #4 @nikgraf | ||
# v0.2.0 | ||
# 0.2.0 | ||
@@ -33,4 +32,4 @@ - Added more linters: flow, JSCS @okonet | ||
# v0.1.1 | ||
# 0.1.1 | ||
- Initial release |
{ | ||
"name": "lint-staged", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Lint files staged by git", | ||
@@ -47,2 +47,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"app-root-path": "^1.2.1", | ||
"minimatch": "^3.0.0", | ||
@@ -52,5 +53,3 @@ "npm-which": "^2.0.0", | ||
"ora": "^0.2.3", | ||
"staged-git-files": "0.0.4", | ||
"strip-eof": "^1.0.0", | ||
"which": "^1.2.9" | ||
"staged-git-files": "0.0.4" | ||
}, | ||
@@ -57,0 +56,0 @@ "devDependencies": { |
@@ -7,6 +7,8 @@ # lint-staged | ||
[Read the Medium post](https://medium.com/@okonetchnikov/make-linting-great-again-f3890e1ad6b8#.8qepn2b5l) | ||
Linting makes more sense when running before commiting you code. By doing that you | ||
can ensure no errors are going into repository and enforce code style. But running a lint process | ||
on a whole project is slow and linting results can be irrelevant. Ultimately you want to lint only | ||
files that will be committed. | ||
files that will be committed. | ||
@@ -23,3 +25,3 @@ This project contains a script that will run arbitary npm tasks against staged files, filtered by | ||
1. Add `{ "lint-staged": "lint-staged" }` to `scripts` section of `package.json` | ||
1. Add `pre-commit": [ "lint-staged" ]` to `package.json` | ||
1. Add `"pre-commit": [ "lint-staged" ]` to `package.json` | ||
@@ -63,3 +65,3 @@ ## Configuration | ||
### ESLint with default parameters | ||
### ESLint with default parameters for *.js and *.jsx | ||
@@ -70,2 +72,5 @@ ```json | ||
"version": "0.1.0", | ||
"scripts": { | ||
"lint-staged": "lint-staged" | ||
}, | ||
"lint-staged": { | ||
@@ -78,3 +83,3 @@ "eslint": "*.@(js|jsx)", | ||
### Stylelint with SCSS syntax (and ESLint) | ||
### ESLint + Stylelint with SCSS syntax | ||
@@ -86,2 +91,3 @@ ```json | ||
"scripts": { | ||
"lint-staged": "lint-staged", | ||
"stylelint-staged": "stylelint --syntax=scss" | ||
@@ -88,0 +94,0 @@ }, |
@@ -1,2 +0,1 @@ | ||
var path = require('path'); | ||
var cp = require('child_process'); | ||
@@ -6,10 +5,7 @@ var sgf = require('staged-git-files'); | ||
var ora = require('ora'); | ||
var which = require('which'); | ||
var npmWhich = require('npm-which')(process.cwd()); | ||
var stripEof = require('strip-eof'); | ||
var assign = require('object-assign'); | ||
var gitBin = which.sync('git'); | ||
var root = cp.execSync(gitBin + ' rev-parse --show-toplevel', { encoding: 'utf8' }); | ||
var config = require(path.join(stripEof(root), 'package.json')); | ||
var appRoot = require('app-root-path'); | ||
var config = require(appRoot.resolve('package.json')); | ||
var defaultLinters = {}; | ||
@@ -16,0 +12,0 @@ var customLinters = config['lint-staged']; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
9440
6
96
71
+ Addedapp-root-path@^1.2.1
+ Addedapp-root-path@1.4.0(transitive)
- Removedstrip-eof@^1.0.0
- Removedwhich@^1.2.9
- Removedstrip-eof@1.0.0(transitive)