Closed LucasLemanowicz closed 5 days ago
Hopefully #2755 and #2756 will help, in the next release of eslint-module-utils and eslint-plugin-import.
Thanks @ljharb - any idea when the next release will be cut?
(btw - looks like while the code changes for #2755 merged in to main
, I can't seem to find the corresponding CHANGELOG entry)
Nope, no idea, but hopefully soon.
I upgraded my NextJS version which also upgraded eslint-plugin-import
from 2.26.0
to 2.28.1
and I am seeing approximately 3x increase in linting time on Vercel. Pinning the eslint-plugin-import to 2.26.0 reduced it back down to normal, as seen in the screenshots here:
main
branch on 2.26.0
(focus on time since previous line):
next-13.5
branch after package was updated to 2.28.1
(focus on time since previous line):
next-13.5
branch after pinning package back to 2.26.0
(focus on time since previous line):
Any idea what could be going on?
I tried upgrading to 2.29.0
and still seeing performance issues. It seems like it might be related to a bew dependency on eslint-import-resolver-typescript
. Attaching a dump of the logs when running eslint --debug
on a single file on 2.26.0 and 2.29.0:
The main time differences are below. This is 2.26.0
:
eslint:linter Generating fixed text for /Users/(...)/src/pages/contact-us.tsx (pass 1) +2s
(...)
eslint:file-enumerator Complete iterating files: ["./src/pages/contact-us.tsx"] +7s
and this is 2.29.0
:
eslint:linter Generating fixed text for /Users/(...)/src/pages/contact-us.tsx (pass 1) +13s
(...)
eslint:file-enumerator Complete iterating files: ["./src/pages/contact-us.tsx"] +17s
There's a new dependency on eslint-import-resolver-typescript
, which might be related to the slowness above, as there seem to be a few issues about performance on that repo's issue tracker: https://github.com/import-js/eslint-import-resolver-typescript/issues?q=is%3Aissue+performance, including one open issue showing that perf has degraded as of 3.1.0: https://github.com/import-js/eslint-import-resolver-typescript/issues/176
I have updated from 2.26.0
to 2.28.x
and the same problem occurred to me.
Also, I found a new circular import warning which did not occur in 2.26.0
.
After I have turned off import/no-cycle
rule, my ESLint's performance has been good enough (almost same performance as 2.26.0
).
I also discovered that limiting the depth of circular import check leads to improved performance.
/** .eslintrc.cjs */
// All but the most important parts have been omitted.
module.exports = {
rules: {
'import/no-cycle': 'off', // Turned off to prevent circular import check.
}
}
This may not be a solution for those who require import/no-cycle
rule, but I hope it can be of some help.
Try 2.30.0, an optimization to no-cycle
was added.
This issue looks very similar to:
Closing; please file a new issue if you're still seeing perf issues in v2.30+.
I was looking at upgrading our
eslint-plugin-import
package from 2.26.0 to 2.27.5 but when I runeslint
after the upgrade, our lint time goes up from ~90 seconds to ~600 seconds.Relevant sections from our package.json:
Here's an excerpt of a run of
eslint --debug .
2.26.0:
2.27.5:
Happy to provide additional logs or configs in case it would be helpful in reproing and debugging.