-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
pre-commit hook ignores index #1114
Comments
see https://github.com/okonet/lint-staged#reformatting-the-code. I think support could be added to only commit the files already staged, but the file matcher for which files to lint is simply a file glob so all matched files will be linted. Also it looks like lint-staged still does not fully support partially staged files -- lint-staged/lint-staged#62 |
Closing as this is something that needs to be fixed in the upstream dependency. |
Just stumbled upon this issue. I really think vue-cli should warn the user when selection “Lint and fix on commit”, that this will break the git workflow. Especially since all partially staged files will silently be commited as a whole! |
Version
3.0.0-beta.6
Reproduction link
https://github.com/noscript/vue-cli-pre-commit-bug
Steps to reproduce
Lint and fix on commit
enabledsrc/App.vue
andsrc/views/Home.vue
git add -p
select changes only fromsrc/App.vue
git commit
What is expected?
Only changes from
src/App.vue
committed.What is actually happening?
Changes from
src/views/Home.vue
get committed too.The text was updated successfully, but these errors were encountered: