-
-
Notifications
You must be signed in to change notification settings - Fork 121
eslint-loader in watch mode only works when a new line is added #78
Comments
i'm running eslint along with webpack
for above line esling gives if i fixed it by adding ;
watch mode does not reloads. if add another line
watch mode reloads |
Maybe it's an webpack caching issue. |
@MoOx commenting the line didn't worked I also use babel loader, if i remove babel loader from webpack.config.js watch mode works perfectly webpack.config.js
|
It looks like issue is with the webpack. with webpack-dev-server its working fine railsed an issue in webpack |
Try using eslint as a loader, not a preloader, after babel (so before on runtime).
|
This issue might be related to #69. My setup is identical to to the module section in kiranps' comment on Feb 6. Removing eslint or commenting out line 71 fixes the issue, but (obviously) disables linting. I also noticed that reloading works correctly when the build runs successfully on the initial run. I hope we can fix this! I use this plugin on another project and it's very convenient, would be nice to be able to not have to constantly restart webpack if I was lazy the day before ;p |
The issue is with how webpack reports errors, see this line. So the absence/presence of a semicolon doesn't really make a difference for webpack as babel loader generates identical code. btw. I created a plugin for webpack called prefetch-context-webpack-plugin which works very well with
All it does is it prefetches every file under a directory and processes it through a loader ( I also fixed error reporting in the plugin, see here though it's a little bit hacky and I'd prefer to raise an issue in webpack regarding that use case. |
This solution worked for me: webpack/webpack#675 (comment) |
As a work around until webpack fixes its error reporting I added a plugin to my project that makes sure the babel output changes even for trivial changes in the input. This forces webpack to reprocesses the changed file which displays the updated eslint messages. |
See webpack-contrib/eslint-loader#78 for one issue with this approach: changes that do not affect the AST (purely stylistic things like adding a missing trailing comma) will not trigger a bundle re-build. To be sure you're seeing all available lint output, run the `npm run lint` command from the console. Also alters the NPM scripts so that "npm test" is used in CI
Note that this issue has been fixed as of Webpack 3 |
Good to know! |
No description provided.
The text was updated successfully, but these errors were encountered: