chore(package): add lint-staged eslint autofix #2946
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces pre-commit hook to run eslint autofix on staged .js files. Most of time you will not waste your time adding whitespace or commas after you draft a PR and the travis fails due to style issues. No more, it is frustrating and tedious. We really treasure your time.
In this time you simply draft your ideas and let
eslint
fix most style issues for you on commit, you just sit and don't have to runeslint
after you revise files.git-exec-and-restage
is less popular but it proves pretty handy over half a year coporate trial. Basicallygit-exec-and-restage
will only rungit add
on fully staged file. It runs linter on partially staged file and it depends on you to commit the style changes of specific hunks later.