Linting slowing build step by a lot
See original GitHub issueDescribe the issue
Currently, linting is part of the webpack build step using eslint-loader
and it greatly slows the build process.
To clear the caches for simulating cold build
rm -rf .cache-loader
rm -rf node_modules/.cache
To Profile
Steps for setting up accurate profiling (on development):
- Install
speed-measure-webpack-plugin
as dev dependency - Wrap merged webpack config with the plugin in
webpack.config.dev.js
like so:
const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
const smp = new SpeedMeasurePlugin();
const developmentConfig = smp.wrap(merge([ /* ... */ ]));
- Disable parallelism in webpack config:
const developmentConfig = smp.wrap(merge([
parts.setFreeVariable('process.env.NODE_ENV', 'development'),
parts.setFreeVariable('process.env.DEBUG_WORKBOX', process.env.DEBUG_WORKBOX),
commonConfig,
{
/* ... */
parallelism: 1, // <-- here
/* ... */
}
]));
- To test with/without linting step, simply comment/uncomment this code block in
webpack.config.common.js
:
// parts.lintJavaScript({
// include: parts.PATHS.app,
// }),
Expected behavior
The build is 45% faster without the eslint-loader
build step.
Profiling results

Left: with linting step Right: without linting step
Additional context
Profiled on branch https://github.com/nusmodifications/nusmods/tree/webpack-4.1/www
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Super-Linter Build step feels slow · Issue #247 - GitHub
Hello! I've eagerly setup Super-Linter and found that it is by far slowest GitHub Action that I run against my PR. Build github/super-linter@v2....
Read more >Lint Performance Tips - Google Groups
Lint tends to get slower for every release. There's a reason for that: It keeps checking more and more things (as of 3.3...
Read more >A Complete Guide to Linting Go Programs - freshman.tech
This article demonstrates a comprehensive linting setup for Go projects, and discusses the best way to introduce it into an existing ...
Read more >Angular project with eslint is super slow - Stack Overflow
Check the output for files that are actually not supposed to be part of the linting process (i.e. from node_modules folder or dist...
Read more >Build Performance - webpack
This guide contains some useful tips for improving build/compilation performance. General. The following best practices should help, whether you're running ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is now implemented via #1052. I removed lint and type checks from the production Webpack config - in CI, those are ran in separate stages, and our deployment process is semi-automated, so all code that’s pushed into production should already have those checks run, which means rerunning them is a waste of time.
For development, Flow, ESLint and Stylelint are run by default, but can be disabled via env variables
DISABLE_FLOW
,DISABLE_ESLINT
andDISABLE_STYLELINT
. We make no assumption about the user’s editor, so by default these are enabled in case the user wants to usenano
to write their code.I still think we need eslint-loader for development, since not all editors support ESLint inline. Hot reload performance is the main concern for development, and I think it should still be acceptable right now.
How about we put it behind a flag that can be disabled by users with editors that have inline ESLint support ? @li-kai @taneliang
I’ve removed
lintJavaScript
from prod script in the Webpack 4 branch