Comments (14)
Hi @ricardogobbosouza, it looks like this issue is still relevant
Our teams have been working on three apps, based on create-react-app4, which ships with eslint-webpack-plugin
Event though, those apps are relatively small, the initial build takes about 1 - 1.5 minutes and rebuild after each change takes approximately from 30sec to > than 1 minute
However, if we disable eslint-webpack-plugin
from cra4 config and set up eslint-loader
, the initial build is reduced to 35 ~ 40 sec and rebuild after each change takes approximately 3-10 secs
We used:
eslint-webpack-plugin@^2.4.1
eslint-loader@^4.0.2
All of us use MacBooks Pro 15 2017-2019
Our config .eslintrc
(.txt extension is used to upload it via github)
It seems, like with current performance of eslint-webpack-plugin
it is impossible for us to use it.
Might a problem be in our .eslintrc?
Or is there any plans to improve the performance of eslint-webpack-plugin
?
If you need any additional info, please, let me know.
from eslint-webpack-plugin.
Faced the exact same issue while migrating. In our case, the recompile times increased by more than 10x.
Tried using lintDirtyModulesOnly
flag, but that resulted in errors not being caught.
from eslint-webpack-plugin.
Upgrading 2.1.0 -> 2.2.0 broke for me. When building I get an error about a missing module:
node:internal/modules/cjs/loader:900
const err = new Error(message);
^
Error: Failed to load plugin 'es5' declared in 'node_modules/focus-visible/.eslintrc.js': Cannot find module 'eslint-plugin-es5'
Require stack:
- /Users/dean/Sites/foo/packages/app/node_modules/focus-visible/__placeholder__.js
Referenced from: /Users/dean/Sites/foo/packages/app/node_modules/focus-visible/.eslintrc.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:900:15)
at Function.resolve (node:internal/modules/cjs/helpers:94:19)
at Object.resolve (/Users/dean/Sites/foo/packages/app/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js:28:50)
at ConfigArrayFactory._loadPlugin (/Users/dean/Sites/foo/packages/app/node_modules/@eslint/eslintrc/lib/config-array-factory.js:1011:39)
at ConfigArrayFactory._loadExtendedPluginConfig (/Users/dean/Sites/foo/packages/app/node_modules/@eslint/eslintrc/lib/config-array-factory.js:831:29)
at ConfigArrayFactory._loadExtends (/Users/dean/Sites/foo/packages/app/node_modules/@eslint/eslintrc/lib/config-array-factory.js:778:29)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/dean/Sites/foo/packages/app/node_modules/@eslint/eslintrc/lib/config-array-factory.js:719:25)
at _normalizeObjectConfigDataBody.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigData (/Users/dean/Sites/foo/packages/app/node_modules/@eslint/eslintrc/lib/config-array-factory.js:664:20)
at _normalizeObjectConfigData.next (<anonymous>) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/dean/Sites/foo/packages/app/node_modules/focus-visible/__placeholder__.js'
],
messageTemplate: 'plugin-missing',
messageData: {
pluginName: 'eslint-plugin-es5',
resolvePluginsRelativeTo: '/Users/dean/Sites/foo/packages/app/node_modules/focus-visible',
importerName: 'node_modules/focus-visible/.eslintrc.js'
}
}
Not sure why it's now trying to lint node_modules files?
Running yarn eslint .
in my project directory works though. I'm just using basic new ESLintPlugin()
in my webpack config.
from eslint-webpack-plugin.
Any updates on this issue @ricardogobbosouza?
It is still reproducible to me using [email protected].
from eslint-webpack-plugin.
Upgrading to 2.2.1 appears to solve the problem.
Using 2.1.0
DONE Compiled successfully in 19460ms
Using 2.2.1
DONE Compiled successfully in 1024ms
from eslint-webpack-plugin.
Hi @decademoon
Resolved on v2.3.0
from eslint-webpack-plugin.
I've ran a few tests for a small-to-middle size project, which my team is currently working on:
eslint-loader
Build: ~01:00
Rebuild: ~00:03
eslint-webpack-plugin^2.4.0 (my previous tests used this version as well)
Cold build (e.g. without .eslintcache): ~01:40
Build: ~01:40
Rebuild: ~00:12
eslint-webpack-plugin^2.5.1
Cold build (e.g. without .eslintcache): ~01:00
Build: ~00:30
Rebuild: ~00:03
My machine: MacBooks Pro 15 2018 macOS Big Sur 11.2.1
At the first glance it looks like the performance of 2.5.1 drastically improved, when compared to 2.4.0
After the .eslintcache file was generated it becomes twice faster than eslint-loader
I guess we will try to switch back to eslint-webpack-plugin for a while to see if it is going to improve our development experience
Nevertheless, awesome work @ricardogobbosouza, thank you very much
I will get back to you in case if we face with any issues after switching to 2.5.1
from eslint-webpack-plugin.
Howe can reproduce or investigate this? Please provide more infromation
from eslint-webpack-plugin.
I can confirm this. It seems that eslint-webpack-plugin
blocks the compilation to do jobs while eslint-loader
doesn't. Incremental compilation is hit even harder. In my project, with one file/line changed, it is almost instant with eslint-loader
but with eslint-webpack-plugin
it takes approx. 15 seconds.
No special step is needed to reproduce. If you want, you can build my project.
eslint-loader
configuration:
const eslintFormatter = require('react-dev-utils/eslintFormatter');
{
enforce: 'pre',
test: /\.(ts|js)x?$/,
exclude: /node_modules/,
use: [
{
loader: 'eslint-loader',
options: {
formatter: eslintFormatter,
emitWarning: true,
},
},
],
},
eslint-webpack-plugin
configuration:
new ESLintPlugin({
extensions: ['js', 'jsx', 'ts', 'tsx'],
emitWarning: true,
}),
from eslint-webpack-plugin.
from eslint-webpack-plugin.
As someone looking to switch from eslint-loader
to eslint-webpack-plugin
, this thread is concerning, given the already unbearable (#33 (comment)) slowness of the former in my current codebase
from eslint-webpack-plugin.
Hi @hecontreraso
Try v2.2.0
from eslint-webpack-plugin.
ultra slow, both new webpack-dev-server and eslint-plugin
from eslint-webpack-plugin.
Hi @jgomezhidalgo, @OlehRb
Try version 2.5.1
from eslint-webpack-plugin.
Related Issues (20)
- Error with eslint error detection HOT 1
- in webpack-dev-server, rule `@typescript-eslint/no-unsafe-assignment` throws an error when an imported type changed HOT 5
- Error if package.json is not in parent directory to the linted code HOT 2
- Build error in ci tool. HOT 4
- Lint Errors Kill Webpack Watch HOT 2
- Add support to the new eslint.config.js format HOT 6
- Checking/validating json files HOT 4
- v4.0.0 much slower than v3.2.0, potentially due to linting cached webpack files 🤷 HOT 3
- Performance: 4.0 Hot Module Replacement build very slow HOT 5
- Enable `cache` eslint HOT 4
- Can Nuxt2 use eslint-webpack-plugin? HOT 2
- lintDirtyModulesOnly relies on a populated cache, and lints all files if cache is not present HOT 2
- Angular 15+16 compile gets stuck at "70% sealing finish module graph ESLintWebpackPlugin_1" HOT 5
- detect new file issues HOT 2
- TS files that contain only typings are not linted HOT 1
- Run ESLint only on modified files HOT 1
- Add new option `flatConfigFile` HOT 2
- Update for ESLint 9 HOT 2
- 'extensions' has been removed HOT 3
- Update the eslint version to 9 HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-webpack-plugin.