Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Adam Mateusz Brożyński
Adam Mateusz Brożyński

Posted on

     

ESLint & Prettier in Nuxt + VSCode

This is how to configure Nuxt with ESLint and Prettier + VSCode to format source on save.

  • Install dependencies in project folder:
$npminstalleslint babel-eslint eslint-config-prettier eslint-plugin-prettier eslint-plugin-vue eslint-loader prettier-D
  • Create.eslintrc.js:
module.exports={root:true,env:{node:true,browser:true},extends:["plugin:vue/recommended","eslint:recommended","prettier/vue","plugin:prettier/recommended"],rules:{"vue/component-name-in-template-casing":["error","PascalCase"],"no-console":process.env.NODE_ENV==="production"?"error":"off","no-debugger":process.env.NODE_ENV==="production"?"error":"off"},globals:{$nuxt:true},parserOptions:{parser:"babel-eslint"}};
  • Install required extensions for VSCode inFile → Settings → Extensions:ESLint,Vetur
  • Create.vscode/settings.json in project folder:
{"editor.formatOnSave":true,"vetur.validation.template":false,"editor.codeActionsOnSave":{"source.fixAll.eslint":true}}

- based on tutorial byAlex Gogl

Top comments(4)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
patarapolw profile image
Pacharapol Withayasakpunt
Currently interested in TypeScript, Vue, Kotlin and Python. Looking forward to learning DevOps, though.
  • Location
    Thailand
  • Education
    Yes
  • Joined
• Edited on• Edited

Apparently, the easiest way is to just usenpx create-nuxt-app, and you have a choice to include everything.

But, VSCode settings can be actually hard for newcomers.

CollapseExpand
 
ordigital profile image
Adam Mateusz Brożyński
.
  • Location
    Częstochowa, Poland
  • Work
    Full stack developer at Ordigital
  • Joined
• Edited on• Edited

Yes, but this article is aimed on non-standard configurations like laravel-nuxt and laravel-nuxt-js by Cristian Pallarés.

CollapseExpand
 
yoktav profile image
Yilmaz
  • Work
    Jr. Front end developer
  • Joined

Thank you

CollapseExpand
 
hamedf62 profile image
hamedf62
  • Joined

Thank you...

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

.
  • Location
    Częstochowa, Poland
  • Work
    Full stack developer at Ordigital
  • Joined

More fromAdam Mateusz Brożyński

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp