File not added to commit still being linted
See original GitHub issueDescription
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
- I try to make a commit with all changed files, except one.
- lint-staged runs
"*.{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
- OS: macOS Mojave 10.14.6
- Node.js: v12.13.1
lint-staged
: 9.5.0git gui
: SourceTree 3.2.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Add all files to a commit except a single file? - Stack Overflow
This project depends on SherlockActionBar, so it needs to be referenced in project.properties, but that messes with the compilation, so now I just...
Read more >Linting Staged Git Files with lint-staged -- newline - Fullstack.io
If any files fail to pass, then they are not committed to the remote repository! Before the files can be committed, you must...
Read more >Push rules - GitLab Docs
Merge requests that contain a file that matches the list are blocked. This push rule does not restrict files already committed to the...
Read more >Tutorial: Removing Large Files from Git - Medium
The large file was just added in the most recent commit ... This situation is more complicated than the first one, but still...
Read more >Configuration - Gitlint - Joris Roovers
You can modify gitlint's behavior by adding a .gitlint file to your git ... git commit exists (yet) for the message being linted,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
Please feel free to improve the readme based on your experience!