Error: Cannot find module 'eslint-webpack-plugin'
Simply followed the instructions via README and when I run npm run watch I receive the error.
Laravel 8.41
"vue": "^3.1.5",
"eslint": "^7.30.0",
"eslint-plugin-vue": "^7.13.0",
"laravel-mix": "^6.0.25",
"laravel-mix-eslint": "^0.2.0",
Seems like this plugin isn't compatible with laravel-mix v6, I'll gladly accept a PR if you get it working, otherwise I'll try to do this when I find some time. It's not a high priority for me as I don't use this anymore
That is too bad. Was just doing research on possible setups with eslint webpack plugin and eslint and started thread at https://laracasts.com/discuss/channels/elixir/webpack-eslint-setups-with-laravel-mix-6 . Do think we need something like
.webpackConfig({
plugins: [
new ESLintPlugin(options)
}),
],
to load plugins in new Laravel Mix 6, but not quite done with the research.
Came to report this also
You need to install eslint-webpack-plugin manually. see https://github.com/riasvdv/laravel-mix-eslint/blob/master/index.js#L9
According to laravel-mix documentation what is returned from dependencies() will be installed by mix if you run npm run dev or npx mix but i don't know why it doesn't auto install.
so after you run
npm install laravel-mix-eslint --save-devyou need to installeslint-webpack-pluginrunnpm install eslint-webpack-plugin --save-devand then follow withnpx mix
@Aslam97 good catch
Hi it seems that the eslint dependency is not auto installed too. Manually ran
yarn add eslint --dev
along with
yarn add eslint-webpack-plugin --dev.
So for anyone encountering this issue in the future, do:
yarn add eslint eslint-webpack-plugin --dev
or the npm equivalent
Yeah with eslint-webpack-plugin added this package does work. Just need to see how I can include prettier in the mix now but ESLint works well. Thanks @Zhythero and @Aslam97