Skip to content

Commit c26ef0e

Browse files
MoOxnecolas
authored andcommitted
Run precommit hook automatically
Help to ensure that code is formatted and linted before commits and PRs. Fix #755 Close #756 Close #754
1 parent b78206d commit c26ef0e

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,6 @@ To run the performance benchmarks in a browser (opening `./packages/benchmarks/i
9191
yarn benchmark
9292
```
9393

94-
### Pre-commit
95-
96-
To format and lint code before commit:
97-
98-
```
99-
yarn precommit
100-
```
101-
102-
To format and lint the entire project:
103-
104-
```
105-
yarn fmt
106-
```
107-
10894
### New Features
10995

11096
Please open an issue with a proposal for a new feature or refactoring before
@@ -118,8 +104,7 @@ that we won't want to accept.
118104
1. Fork the repository and create your branch from `master`.
119105
2. If you've added code that should be tested, add tests!
120106
3. If you've changed APIs, update the documentation.
121-
4. Lint and format your code (`yarn precommit`).
122-
5. Ensure the tests pass (`yarn test`).
107+
4. Ensure the tests pass (`yarn test`).
123108

124109
You can now submit a pull request, referencing any issues it addresses.
125110

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"eslint-plugin-promise": "^3.6.0",
4242
"eslint-plugin-react": "^7.5.1",
4343
"flow-bin": "^0.61.0",
44+
"husky": "^0.14.3",
4445
"jest": "^21.2.1",
4546
"lerna": "^2.5.1",
4647
"lint-staged": "^4.1.3",
@@ -58,7 +59,7 @@
5859
"**/*.js": [
5960
"fmt:cmd",
6061
"git update-index --again",
61-
"lint:cmd"
62+
"eslint"
6263
]
6364
},
6465
"author": "Nicolas Gallagher",

yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4100,6 +4100,14 @@ https-browserify@^1.0.0:
41004100
version "1.0.0"
41014101
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
41024102

4103+
husky@^0.14.3:
4104+
version "0.14.3"
4105+
resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.3.tgz#c69ed74e2d2779769a17ba8399b54ce0b63c12c3"
4106+
dependencies:
4107+
is-ci "^1.0.10"
4108+
normalize-path "^1.0.0"
4109+
strip-indent "^2.0.0"
4110+
41034111
hyphenate-style-name@^1.0.1, hyphenate-style-name@^1.0.2:
41044112
version "1.0.2"
41054113
resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.2.tgz#31160a36930adaf1fc04c6074f7eb41465d4ec4b"
@@ -5609,6 +5617,10 @@ normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-
56095617
semver "2 || 3 || 4 || 5"
56105618
validate-npm-package-license "^3.0.1"
56115619

5620+
normalize-path@^1.0.0:
5621+
version "1.0.0"
5622+
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379"
5623+
56125624
normalize-path@^2.0.0, normalize-path@^2.0.1:
56135625
version "2.1.1"
56145626
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9"

0 commit comments

Comments
 (0)