eslint-plugin-diff icon indicating copy to clipboard operation
eslint-plugin-diff copied to clipboard

potential bug - only running once?

Open burtonator opened this issue 2 years ago • 2 comments

I'm trying to debug why the diff plugin isn't working and it seems it "works" once... and then the second time you call it it has a different code path.

Is the cache causing a problem potentially?

I'm still trying to debug what's happening but it should be the same path each time but the first run takes a different path and doesnt' call getPreProcessor and shouldBeProcessed isn't applied.

burtonator avatar Dec 11 '22 18:12 burtonator

confirmed that the cache breaks this and causes non-determinstic behavior.

especially if you change ESLINT_PLUGIN_DIFF_COMMIT to an earlier commit like the git init checksum.

It won't show the updated output unless you clear the cache.

subskribe-kevin avatar Dec 11 '22 22:12 subskribe-kevin

I think this could potentially be fixed by moving ESLINT_PLUGIN_DIFF_COMMIT into the eslint config.

I think the problem is that eslint doesn't realize that the ESLINT_PLUGIN_DIFF_COMMIT has changed (why would it?) and then can't invalidate the cache.

subskribe-kevin avatar Dec 11 '22 22:12 subskribe-kevin