Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromvuejs/vue

Commitea61d98

Browse files
committed
add pre-commit hook
1 parente0ab042 commitea61d98

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

‎.github/CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ After cloning the repo, run:
5959
$ npm install
6060
```
6161

62+
If you are on a Unix-like system, optionally install the Git pre-commit hook with:
63+
64+
```bash
65+
$ npm run install:hooks
66+
```
67+
68+
This will run Flow and ESLint on changed files before each commit.
69+
6270
###Commonly used NPM scripts
6371

6472
```bash

‎build/git-hooks/pre-commit

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
files_to_lint=$(git diff --cached --name-only --diff-filter=ACM| grep'\.js$')
4+
5+
if [-n"$files_to_lint" ];then
6+
flow&& NODE_ENV=production eslint$files_to_lint
7+
fi

‎package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"sauce":"SAUCE=true karma start build/karma.sauce.config.js",
4343
"bench:ssr":"npm run build:ssr && NODE_ENV=production node benchmarks/ssr/renderToString.js && NODE_ENV=production VUE_ENV=server node benchmarks/ssr/renderToStream.js",
4444
"release":"bash build/release.sh",
45-
"release:weex":"bash build/release-weex.sh"
45+
"release:weex":"bash build/release-weex.sh",
46+
"install:hooks":"ln -fs ../../build/git-hooks/pre-commit .git/hooks/pre-commit"
4647
},
4748
"repository": {
4849
"type":"git",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp