DEV Community

samydoesit
samydoesit

Posted on

2 1

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)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay