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
File not added to commit still being linted #755
Comments
That’s a faulty behavior and should not happen. Can you please run lint-stages in debug mode and add the output to the issue (as the new issue template asks you to). Thanks. |
I think since your command contains Try using simply |
Ah yeah that’s a good catch. I missed that fact. |
@iiroj since it’s a most common mistake with the library I’m wondering there is a way to detect that and warn users about wrong configuration. Ideas? |
@okonet we already detect |
it could I think if we’d manage the list of marchers and warnings. Not too much of the work I think. |
@iiroj thanks for the suggestion, worked like a charm! Maybe its worth mentioning this in the Readme? Honestly I just started using this tool today and the articles I read on implementing this (+ husky) suggest the And of course thanks @okonet for this package, I wish I applied on my repo before so I didn't woke up this morning with a broken app because last's night no-undef bug (😅) Cheers! |
We do have a lot of advanced function examples, so maybe we should add some basic examples as well. I'll create a separate issue. |
What article suggest this config? We should fix that. |
@okonet I meant random Medium/blog articles where people suggest how to use husky + lint-staged. |
Please feel free to improve the readme based on your experience! |
Description
After reading the famous issue + feature #62 I think it doesn't cover the case when you have some files with changes and you want to ignore them from now (because you know they are not ready yet for committing).
But lint-staged is still checking for those files so husk rejects the commit because the file has a (known) error.
Steps to reproduce
"*.{js,jsx}": ["eslint . --fix", "git add"]
and finds thatDateList.js
has an error (but I already know this and thats why I didnt added the file to the commit)Theres a way to prevent this behaviour using lint-staged or may I need to manually stage the file and unstage after the commit is done?
Thanks.
Environment
lint-staged
: 9.5.0git gui
: SourceTree 3.2.1The text was updated successfully, but these errors were encountered: