Skip to content

Commit

Permalink
adds linter and husky hooks (#3)
Browse files Browse the repository at this point in the history
* adds linter and husky hooks

* husky hooks

* fake change to see linting working on gh actions

* fix eslint issue
  • Loading branch information
wesleyfuchter authored Feb 22, 2021
1 parent 3c4d767 commit be65312
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
"es2021": true,
"jest/globals": true
},
"ignorePatterns": [
"src/setupTests.js",
"src/reportWebVitals.js",
"build/*",
"coverage/*"
],
"extends": [
"plugin:react/recommended",
"airbnb"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
- name: Installs dependencies
run: npm install

- name: Run Linter
run: npm run eslint

- name: Run build
run: npm run build

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pull-request-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
- name: Installs dependencies
run: npm install

- name: Run Linter
run: npm run eslint

- name: Run build
run: npm run build

Expand Down
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run eslint
npm test
5 changes: 5 additions & 0 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"graphql": "^15.5.0",
"husky": "^5.1.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-router-dom": "^5.2.0",
Expand All @@ -20,7 +21,8 @@
"build": "react-scripts build",
"test": "react-scripts test --watchAll=false --coverage",
"eject": "react-scripts eject",
"deploy": "echo 'work in progress'"
"deploy": "echo 'work in progress'",
"eslint": "eslint ."
},
"eslintConfig": {
"extends": [
Expand Down

0 comments on commit be65312

Please sign in to comment.