Enabling the fix option for the plugin with webpack-dev-server's watch mode seems to cause tslint to fix the issues one-by-one-ish while webpack compiles everything after each change. This is painful if you have multiple mistakes when doing eg. save all with your editor.
To reproduce this, enable fix for the plugin and start webpack-dev-server in watch mode. To enable fix, change your webpack configuration file to:
new TslintWebpackPlugin({
// ...
fix: true
})
The log looks like this:
webpack: Compiled successfully.
[tslint-plugin] Starting linter in separate process...
webpack: Compiling...
...
webpack: Compiled successfully.
[tslint-plugin] Starting linter in separate process...
webpack: Compiling...
...
webpack: Compiled successfully.
[tslint-plugin] Starting linter in separate process...
webpack: Compiling...
...
webpack: Compiled successfully.
[tslint-plugin] Starting linter in separate process...
webpack: Compiling...
...
(Notice how tslint-plugin never completes.)
It seems that this happens because:
Webpack compilation finishes
tslint starts
tslint fixes an issue and continues to the next file
webpack detects the change and starts compiling
tslint-webpack-plugin kills tslint
Go to step 1.
I have no idea how to fix this properly, but the hooks in plugin.js seem to support my theory.
I'm still using webpack@3 if that matters.
EDIT: Changed the loop to illustrate the problem better
Enabling the
fix
option for the plugin withwebpack-dev-server
's watch mode seems to causetslint
to fix the issues one-by-one-ish while webpack compiles everything after each change. This is painful if you have multiple mistakes when doing eg. save all with your editor.To reproduce this, enable
fix
for the plugin and startwebpack-dev-server
in watch mode. To enablefix
, change your webpack configuration file to:The log looks like this:
(Notice how
tslint-plugin
never completes.)It seems that this happens because:
tslint
startstslint
fixes an issue and continues to the next filewebpack
detects the change and starts compilingtslint-webpack-plugin
killstslint
I have no idea how to fix this properly, but the hooks in
plugin.js
seem to support my theory.I'm still using
webpack@3
if that matters.EDIT: Changed the loop to illustrate the problem better