Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM] TFAC-292 Lint on Pre-Commit #153

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn run lint --fix && yarn run relay && yarn run jest -o
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -7,14 +7,15 @@
"dev": "echo \"Use the 'yarn go' command to develop locally.\"",
"build": "NODE_ENV=test yarn run test && NODE_ENV=production yarn run relay && next build",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll want to add yarn run lint to this build command

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that sounds good.

"start": "NODE_ENV=production next start --port 3001",
"test": "yarn run lint && yarn run relay && jest",
"test": "yarn run relay && jest",
"test:watch": "yarn run relay && jest --watch",
"test:coverage": "yarn run test --coverage",
"format": "prettier \"**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
"format:fix": "yarn run format --write",
"lint": "eslint \"**/*.{js,jsx}\" --ignore-pattern \"next.config.*js\"",
"relay": "relay-compiler --src ./src/ --artifactDirectory ./src/relay/__generated__ --exclude '**/__test__/**' '**/__generated__/**' --schema ./src/schema/schema.graphql",
"find-unused": "echo \"This will find unused files. However, note that it ignores mocks, tests, and utils in the testHelpers directory.\n\" && next-unused"
"find-unused": "echo \"This will find unused files. However, note that it ignores mocks, tests, and utils in the testHelpers directory.\n\" && next-unused",
"prepare": "husky install"
},
"dependencies": {
"@material-ui/core": "^4.11.2",
@@ -66,6 +67,7 @@
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"graphql": "^15.4.0",
"husky": "^6.0.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"jest-next-dynamic": "^1.0.1",
2 changes: 1 addition & 1 deletion src/components/DashboardPopover.js
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ const DashboardPopover = (props) => {
return (
<Popover
open={open}
anchorEl={anchorEl}
anchorEl={open && anchorEl}
onClose={onClose}
anchorOrigin={{ horizontal: 'center', vertical: 'bottom' }}
transformOrigin={{ horizontal: 'center', vertical: 'top' }}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -5966,6 +5966,11 @@ human-signals@^1.1.1:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz"
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==

husky@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/husky/-/husky-6.0.0.tgz#810f11869adf51604c32ea577edbc377d7f9319e"
integrity sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ==

hyphenate-style-name@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz"