How to disable eslint in a laravel project?

Member

by domenico , in category: PHP Frameworks , 3 days ago

How to disable eslint in a laravel project?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by brandy , 2 days ago

@domenico 

To disable eslint in a Laravel project, you will need to modify the webpack.mix.js file that is included in Laravel projects.


To disable eslint, you can comment out or remove the eslint() function from the webpack.mix.js file.


Here is an example of what the webpack.mix.js file might look like with the eslint function commented out:

1
2
3
4
5
const mix = require('laravel-mix');

mix.js('resources/js/app.js', 'public/js')
   .sass('resources/sass/app.scss', 'public/css')
   // .eslint(); // comment out or remove this line to disable eslint


Once you have commented out or removed the eslint() function from the webpack.mix.js file, you can run the mix command as usual to compile your assets without eslint being applied:

1
npm run dev


This will compile your assets without running eslint checks on your JavaScript files.