-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: master
Are you sure you want to change the base?
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/gladly-team/tab-web/Hig9tH1MzT1oZejfccwYNSMJbM5v [Deployment for 1bfb75e failed] |
Codecov Report
@@ Coverage Diff @@
## master #153 +/- ##
=======================================
Coverage 90.22% 90.22%
=======================================
Files 86 86
Lines 1217 1217
Branches 289 289
=======================================
Hits 1098 1098
Misses 107 107
Partials 12 12 Continue to review full report at Codecov.
|
@@ -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", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that sounds good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely add lint checking in the build command. My other suggestions are open-ended: up to you if you want to add them now or not.
@@ -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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that sounds good.
.husky/pre-commit
Outdated
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn run lint && yarn test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be useful to have Husky fix linting errors when possible and commit the fixes (e.g., this article on using lint-staged
). What do you think?
I also saw a suggestion to run only affected tests, like using Jest's --changedSince=master or --onlyChanged flags, which sounds great. I'm a little skeptical of the overhead of running the whole test suite on commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great idea - I'm currently struggling getting any flags (--changedSince, --onlyChanged and --findRelatedTests) to pick up, well, any tests, which is slowing down my velocity on this somewhat.
5295d2d
to
777e5b2
Compare
777e5b2
to
1bfb75e
Compare
No description provided.