DEV Community

samydoesit
samydoesit

Posted on

NUXT.js using Prettier/ESlint with standardJS rule set

I lost some hair setting this one up correctly.
So i want to share my "vscode nuxt prettier eslint standardJS config" with you.

Assuming you have a fresh install of nuxt like:

npx create-nuxt-app EsLintTest

cd EsLintTest

yarn add -D prettier-standard
yarn add -D eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node eslint-plugin-prettier eslint-config-prettier prettier-config-standard eslint-config-prettier-standard

Inside your eslintrc.js extend:
eslintrc.js

extends: [
    ...
    'prettier-standard'
  ],

Enable eslint on save inside vscode like:
.vscode/settings.json

"editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }

Enjoy.

Thanks to:
https://github.com/sheerun/prettier-standard
https://github.com/npetruzzelli/eslint-config-prettier-standard

Top comments (0)