-
Notifications
You must be signed in to change notification settings - Fork 132
style(automatting and quality): Add prettier and eslint to run on commit and build, deprecate jshint #336
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
Conversation
|
@haoliu-amp @jooohhn @kelvin-lu How do you feel about using lint-staged to run prettier and eslint against every commit? I've found it to be very helpful but if the team consistently uses VScode we can also just utilize the autosave/format config from that. |
|
think it's a good idea since other contributors might not be using vscode and can introduce lint errors (which I've seen @jooohhn catch out of diligence - but it would be better if this was automated.) |
950c48f to
ac78975
Compare
ac78975 to
2366868
Compare
fd2822d to
f8ab2d5
Compare
f8ab2d5 to
1dcc59b
Compare
kelvin-lu
left a comment
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.
lgtm! will defer to @jooohhn though for another review
jooohhn
left a comment
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.
LGTM! Thanks @kelsonpw
Summary
This PR adds a few packages:
prettier - for code formatting
eslint - for code quality and formatting
husky - for running prettier and eslint based on a git hook
lint-staged - runs prettier and eslint against staged files on the
pre-commithookThis PR removes a package:
jshint - outdated js code quality tool which has been long replaced by eslint, I removed any jshint related code.
It also adds two new tests to

test.yml, one for prettier check and one for eslint check, test will fail if either dont pass. proof (had to push with --no-verify to skip commit hooks):I also copied over the
.vscodefolder from Amplitude-Node, removing any TS specific stuffChecklist