import-js / import-js/eslint-plugin-import

Eslint is slow when used with webpack

Open
#788 29 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

performance
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

I am wondering if it is possible to boost up performance when using eslint-plugin-import with webpack.

In my project:

  • I have 4500 modules (find node_modules/ -type f -name "package.json" | wc -l)
  • I have 500 files that I am eslinting
  • I use 8 aliases in webpack config resolve.alias
  • I use 8 loader rules in webpack config module.rules.

Eslinting lasts ~30s, and I can see that import/no-unresolved takes most of the time:

Rule                              | Time (ms) | Relative
:---------------------------------|----------:|--------:
import/no-unresolved              |  4983.197 |    28.2%
react/prop-types                  |  1694.653 |     9.6%
react/sort-comp                   |  1321.233 |     7.5%
react/no-multi-comp               |  1264.966 |     7.2%
react/require-render-return       |  1221.941 |     6.9%
import/no-named-as-default        |   665.776 |     3.8%
react/no-deprecated               |   524.655 |     3.0%
indent                            |   261.081 |     1.5%
import/no-named-as-default-member |   248.505 |     1.4%
react/jsx-curly-spacing           |   198.665 |     1.1%

Any suggestions on improvement?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the reported profile as the starting point: import/no-unresolved is the main cost while resolving 4,500 packages across 500 files with webpack aliases and loader rules. Inspect the plugin's webpack resolution path and establish a reproducible benchmark; done means a measured improvement without changing resolution behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
performance, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.