Fix Pre-push hook to disallow improper formatting #78
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.
Problem
The current pre-push hook runs npm run lint which runs eslint with the --fix flag. This allows the linter to run successfully even though the pushed code contains formatting issues that are fixed by the --fix flag. Since the commit has already been done, the flag does nothing to truly resolve the issue.
Closes [#75]
Solution
lint
/lint-ts
/lint-js
scripts to exclude the--fix
flag.lint:fix
/lint-ts:fix
/lint-js:fix
which include the--fix
flag.This way, the pre-push hook will be running the linter without the
--fix
flag and disallow improper formatting from getting pushed.Tests