How to update your @nuxtjs/eslint-module from v2 to v3.

Raymond
2 min readDec 3, 2020

--

I was spending a lot of time figuring out why I my app kept crashing and I hope this write up will help those who are struggling to understand where your build is breaking during your upgrade from v2 to v3 upgrade of this package. Here are the steps to upgrade.

1. Install package

Update eslint to be at least v7 before installing eslint-webpack-plugin.

npm install eslint@latest -save-dev
npm install eslint-webpack-plugin -save-dev

2. Configure nuxt.config.js

Configure nuxt.config.js to use updated module. Replace eslint-loader with eslintplugin.

You may also configure options within nuxt.config.js, but it is highly recommended to use eslintrc.js to configure options to make this file cleaner.

3. Test eslint works

npm run lint
> eslint - ext .js,.ts,.vue - ignore-path .gitignore .

Remember to test your builds and run your tests.

Sum Up

  • Install eslint and eslint-webpack-plugin
  • Replace eslint-loader with eslintplugin within nuxt.config.js
  • Test out eslint with your eslint command within package.json

Let me know if I need to add more clarifications! I hope this helped you! Cheers! 🍺

#nuxtjs #vue #eslint #eslint-module #help #npm #eslintplugin #js #nodejs #node

Reference:

--

--