Skip to content
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

Relax rule: import/no-absolute-path #861

Closed
feross opened this issue Apr 14, 2017 · 3 comments
Closed

Relax rule: import/no-absolute-path #861

feross opened this issue Apr 14, 2017 · 3 comments

Comments

@feross
Copy link
Member

feross commented Apr 14, 2017

I would like to relax the import/no-absolute-path rule which "Forbids import of modules using absolute paths". It's not that I think absolute imports are a good idea, it's just that this rule is incredibly slow!

I opened an issue about it on the eslint-plugin-import repo: import-js/eslint-plugin-import#803

Almost 25% of linting time is spent in that one rule. Since this isn't actually a very common error (0 repos in our test suite actually failed when this was added, it's no big deal to just remove it, IMO)

Here's the raw output:

TIMING=1 standard                                                                                                                                         master
Rule                         | Time (ms) | Relative
:----------------------------|----------:|--------:
import/no-absolute-path      |    27.906 |    24.3%
indent                       |     7.070 |     6.2%
no-extra-parens              |     4.939 |     4.3%
comma-dangle                 |     4.313 |     3.8%
no-unused-vars               |     3.695 |     3.2%
no-regex-spaces              |     2.834 |     2.5%
space-in-parens              |     2.611 |     2.3%
no-useless-return            |     2.361 |     2.1%
no-unmodified-loop-condition |     2.310 |     2.0%
block-spacing                |     2.126 |     1.9%
@feross
Copy link
Member Author

feross commented Apr 14, 2017

Confirmed a noticable (150-200ms) improvement on a real-world repo (webtorrent):

Before:

$ rm -rf ~/.standard-cache && time ~/code/standard/bin/cmd.js
2.74s user 0.16s system 123% cpu 2.353 total

After:

$ rm -rf ~/.standard-cache && time ~/code/standard/bin/cmd.js
2.55s user 0.15s system 124% cpu 2.178 total

@feross
Copy link
Member Author

feross commented Apr 14, 2017

Released as 10.0.2

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018
@standard standard unlocked this conversation Jul 28, 2019
@feross
Copy link
Member Author

feross commented Jul 28, 2019

This rule will be re-enabled in standard v14 since the performance issues with it have been fixed now See: #1343

@feross feross modified the milestone: standard v14 Jul 28, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants