-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no-absolute-path
is incredibly slow
#803
Comments
Hi. I have a possible explanation for your question. Please keep in mind that I am not very familiar with the code base, but I believe my explanation makes sense. This specific rule uses a common shared helper to determine whether the path is absolute or not. This generic shared helper also resolves every import to determine "the full module filesystem path". Now strictly speaking, for However, the output of
From my own project, if I only enable
If I enable some other rules, which run before
So in short, if you only use this rule from It should of course also be possible to refactor |
@feross that is exciting! edit: everything I say below is true, but totally irrelevant for this rule. not sure why it's so slow, I need to look at #843 ...but in general @jseminck is right, a bunch of dependency parsing has to happen internally and generally that means one rule looks really slow, but really it's just being evaluated first and the ASTs/export maps for dependencies are cached for the subsequently evaluated rules to use. The *if it's not a dependency or only a dependency (not being linted), it's only parsed once |
merged and published as 2.7.0. thanks @jseminck for diagnosing and making the PR! |
Awesome, just saw this. Thanks for diagnosing, PRing, and merging! |
Hey! Great package you have here. We just started using it in StandardJS!
One of our team members, @Flet, was doing some performance testing and noticed that the
import/no-absolute-path
rule is the slowest rule in our entire set of ESLint rules, by far. Check it out:There might be a good reason for this, but I just wanted to check if this is expected behavior? We're probably going to have to disable the rule for now, since it's not worth the performance cost.
Is there any way to make it faster?
The text was updated successfully, but these errors were encountered: