git-format-staged
Advanced tools
Comparing version 2.1.0 to 2.1.1
{ | ||
"name": "git-format-staged", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Git command to transform staged files according to a command that accepts file content on stdin and produces output on stdout.", | ||
"scripts": { | ||
"precommit": "./git-format-staged --formatter prettier-standard '*.js'", | ||
"commitmsg": "commitlint -e $GIT_PARAMS", | ||
"test": "ava", | ||
@@ -12,3 +10,5 @@ "prepublishOnly": "sed -i \"s/\\$VERSION/$npm_package_version/\" git-format-staged", | ||
}, | ||
"bin": "./git-format-staged", | ||
"bin": { | ||
"git-format-staged": "git-format-staged" | ||
}, | ||
"main": "./no-main.js", | ||
@@ -33,30 +33,38 @@ "repository": { | ||
"release": { | ||
"branch": "master" | ||
"branches": "master" | ||
}, | ||
"devDependencies": { | ||
"@babel/plugin-transform-flow-strip-types": "^7.0.0-beta.46", | ||
"@commitlint/cli": "^6.2.0", | ||
"@commitlint/config-angular": "^6.1.3", | ||
"ava": "^1.0.0-beta.4", | ||
"flow-bin": "^0.72.0", | ||
"fs-extra": "^6.0.1", | ||
"husky": "^0.14.3", | ||
"prettier-standard": "^8.0.1", | ||
"semantic-release": "^15.5.0", | ||
"strip-indent": "^2.0.0", | ||
"tmp": "0.0.33" | ||
"@commitlint/cli": "^8.3.5", | ||
"@commitlint/config-conventional": "^8.3.4", | ||
"@types/fs-extra": "^8.1.0", | ||
"@types/tmp": "^0.1.0", | ||
"ava": "^3.8.1", | ||
"eslint": "^5.16.0", | ||
"fs-extra": "^9.0.0", | ||
"husky": "^4.2.5", | ||
"micromatch": "^4.0.2", | ||
"prettier-standard": "^9.1.1", | ||
"semantic-release": "^17.2.3", | ||
"strip-indent": "^3.0.0", | ||
"tmp": "0.2.0", | ||
"ts-node": "^8.9.1", | ||
"typescript": "^3.8.3" | ||
}, | ||
"ava": { | ||
"babel": { | ||
"testOptions": { | ||
"plugins": [ | ||
"@babel/plugin-transform-flow-strip-types" | ||
] | ||
} | ||
}, | ||
"color": false, | ||
"extensions": [ | ||
"ts" | ||
], | ||
"require": [ | ||
"ts-node/register" | ||
], | ||
"files": [ | ||
"test/**/*_test.js" | ||
"test/**/*_test.ts" | ||
] | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS", | ||
"pre-commit": "./git-format-staged --formatter prettier-standard '*.js'" | ||
} | ||
} | ||
} |
@@ -104,3 +104,3 @@ # git-format-staged | ||
$ git-format-staged --no-write -f 'eslint --stdin >&2' 'src/*.js' | ||
$ git-format-staged --no-write -f 'eslint --stdin --stdin-filename "{}" >&2' 'src/*.js' | ||
@@ -180,2 +180,6 @@ If this command is run in a pre-commit hook, and the lint command fails the | ||
and so on. | ||
- [pretty-quick][] formats staged files with prettier. By default pretty-quick | ||
will abort the commit if files are partially staged to allow the user to | ||
decide how to re-stage changes from formatting. The result is more manual | ||
effort compared to git-format-staged. | ||
- the one-liner | ||
@@ -190,3 +194,4 @@ `git diff --diff-filter=d --cached | grep '^[+-]' | grep -Ev '^(--- a/|\+\+\+ b/)' | LINT_COMMAND` | ||
[pre-commit]: https://pre-commit.com/#pre-commit-during-commits | ||
[pretty-quick]: https://www.npmjs.com/package/pretty-quick | ||
[lint-staged]: https://github.com/okonet/lint-staged | ||
[lint changed hunks]: https://github.com/okonet/lint-staged/issues/62#issuecomment-383217916 |
Sorry, the diff of this file is not supported yet
22206
195
15
15221