question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

File not added to commit still being linted

See original GitHub issue

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

  1. I try to make a commit with all changed files, except one.

lint-staged

  1. lint-staged runs "*.{js,jsx}": ["eslint . --fix", "git add"] and finds that DateList.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.0
  • git gui: SourceTree 3.2.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
iirojcommented, Dec 16, 2019

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.

0reactions
okonetcommented, Dec 17, 2019

Please feel free to improve the readme based on your experience!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found