Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Adding husky and pre-commit hooks #55

Merged
merged 3 commits into from
Oct 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ Run `npm run build` to compile the code to Javascript.

Run `node dist/examples/runFasterCode.js` (to use GraphQL) or `node dist/examples/runOldCode.ts` (to use REST calls), to run the example program. It requires internet access, since it calls the GitHub API. It will take a couple minutes to complete. Some of the output includes the word "ERROR", so don't panic.

Ensure to lint your code by running `npm run lint` before submitting any code for review. `npm run lint:fix` will automatically fix any errors.
Ensure to lint your code by running `npm run lint` before submitting any code for review. Either manually fix the errors or run `npm run lint:fix` to automatically fix any errors.

Husky is set up to run linting checks pre-commit which should prevent being able to commit linting errors; however, There is a [bug](https://github.com/typicode/husky/issues/639) in husky where occasionally the hooks won't run in an IDE.

## Local testing of the npm packaging

Expand Down
194 changes: 194 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"types": "dist/src/mariner/index.d.ts",
"author": "",
"license": "Apache-2.0",
"husky": {
"hooks": {
"pre-commit": "npm run lint"
}
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"check": "npx eslint --print-config src/* | npx eslint-config-prettier-check",
Expand Down Expand Up @@ -39,6 +44,7 @@
"eslint": "^7.10.0",
"eslint-config-prettier": "^6.12.0",
"eslint-plugin-prettier": "^3.1.4",
"husky": "^4.3.0",
"prettier": "^2.1.2",
"typescript": "^4.0.3"
},
Expand Down