laravel-mix-eslint

raw JSON →
0.2.0 verified Sat Apr 25 auth: no javascript maintenance

A Laravel Mix extension (v0.2.0) that adds ESLint support to Mix builds (v2.1+). Automatically integrates eslint-webpack-plugin into the Mix pipeline. Usage is simple: require the package in webpack.mix.js, then call .eslint({…}) with any eslint-webpack-plugin options. Last release appears stable but no recent updates.

error Module not found: Can't resolve 'eslint-webpack-plugin'
cause Missing eslint-webpack-plugin dependency.
fix
Run npm install eslint-webpack-plugin --save-dev
error mix.eslint is not a function
cause Extension not loaded or Mix version too old.
fix
Ensure require('laravel-mix-eslint') is called and Mix >=2.1.7
gotcha Option fix: true may modify source files in place. Use with caution.
fix Set fix: false or run in CI with read-only.
gotcha ESLint configuration must be present in your project (e.g., .eslintrc); otherwise no rules are applied.
fix Create an .eslintrc file or install a preset like eslint-config-standard.
npm install laravel-mix-eslint
yarn add laravel-mix-eslint
pnpm add laravel-mix-eslint

Shows how to require the extension and call .eslint() with options in a Laravel Mix file.

// Install: npm install laravel-mix-eslint --save-dev
// In webpack.mix.js:
let mix = require('laravel-mix');
require('laravel-mix-eslint');
mix
  .js('resources/assets/js/app.js', 'public/js')
  .eslint({
    fix: true,
    extensions: ['js']
  })
  .less('resources/assets/less/app.less', 'public/css');