I need a way to run ESLint on only the code lines or blocks that have changed on a branch. The idea is, that we have a big old code base and we want to enforce ESLint rules at least moving forward.
I implemented it in CI linting all the files that changed in a PR. But people are touching one line in a file and all of a sudden they have to fix 77 ESLint errors.
Personally I'm not at all concerned for them, but they are bigger and stronger than me and I need to make some baby steps here I guess.
So I can get a list of all the files changed for a particular branch. And I suspect I can do a diff and parse it and pull out all the line numbers that changed and then run ESLint and filter the results by the line numbers but this sounds like a colossal pain.
My question is is there not some better real way to do this? I'm not the first person to need this.
Just to be clear I understand that this "requirement" is strictly for edge cases such as mine where the burden of a whole file change is just too great. It's not optimal. It is sub-optimal, but if I don't do this I don't get anything so I have to pick my battles.