When working with JavaScript files, depending on the existing code-base, it can be common to come across code like this:
if( i == 2 ) { var bIsSupposedToBeTrue = false; // the line I actually need to fix eval('badbadbad'); }; This code has several issues that I need to fix to pass eslint. For example, the double equals, accounting for hoisting, bad use of semi-colons and the usage of eval.
This code also has a line of code that I want to fix for the task I am currently working on - right in the middle of the ugly code.
I want to be separate the eslint fixes from the actual fix that I originally intended to work on.
Another complicating factor is usually I want to fix the eslint errors as I work, not at the end after I have already committed the target work.
I could reset --mixed, and then git add -p, but interactive staging isn't as fine-grained as I need.
Any git advice on how to separate-out the eslint changes and the originally-intended change? Imagine if this spanned multiple files.
Something like character-wise interactive staging?
I should also add that I only wish to accomplish this via the command-line (no gui tools).