You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The dependencies from package.json are cached for this rule, but it looks like when eslint is running as a daemon, like an IDE (VSCode or IntelliJ IDEA), the cache is not cleared properly, causing errors to keep showing if package.json is modified.
It looks like Program:exit is defined in the wrong place in the rule. I'm not sure what the intended behavior was, but to me it looks like a simple bug, as Program:exit should be returned from create like so:
instead, Program:exit is defined on the same level as create, causing it to be ignored.
Though as Program:exit is ran for each file, the cache would be quite useless in this case. Perhaps the file modified time could be checked to trigger a reload, but I'm also not seeing any slowdowns from not caching at all, but that might just be for my use case. (the bulk of the time is spent in reportInMissing ~677ms (because of the typescript resolver) vs ~30ms in getDependencies (uncached))
Can anyone confirm?
The text was updated successfully, but these errors were encountered:
Looks like the Program:exit visitor was added in 7f251b2 / #2374, and I agree with you that it should be inside the create, object-assigned onto the moduleVisitor return value - however, as you note, fixing this would cause the cache to be cleared after every file, and probably slow down the lint rule significantly.
eslint isn't designed to run as a daemon, and thus shouldn't be - there's no signalling built into eslint that would enable a long-running cache to clear things efficiently.
The dependencies from
package.json
are cached for this rule, but it looks like when eslint is running as a daemon, like an IDE (VSCode or IntelliJ IDEA), the cache is not cleared properly, causing errors to keep showing if package.json is modified.It looks like
Program:exit
is defined in the wrong place in the rule. I'm not sure what the intended behavior was, but to me it looks like a simple bug, asProgram:exit
should be returned fromcreate
like so:instead,
Program:exit
is defined on the same level ascreate
, causing it to be ignored.Though as
Program:exit
is ran for each file, the cache would be quite useless in this case. Perhaps the file modified time could be checked to trigger a reload, but I'm also not seeing any slowdowns from not caching at all, but that might just be for my use case. (the bulk of the time is spent inreportInMissing
~677ms (because of the typescript resolver) vs ~30ms ingetDependencies
(uncached))Can anyone confirm?
The text was updated successfully, but these errors were encountered: