3

After installing Nuxt.js with this command npx create-nuxt-app <myapp> everything working fine, but when I tried to change the styles code on layout/default.vue I got these errors:

241:9 error Insert prettier/prettier

I'm using Visual Studio Code, so I changed the settings from Preferences > settings > Extensions > Vetur, I changed the Format > Default Formatter: CSS = none and Default Formatter: HTML = none.

Still, the problem persists. I tried to fix using this command I found on GitHub npm run lint -- --fix and it worked, but every time I add a new file to the project, I got the error again! So funny! I'm new in Nuxt.js.

I have another's projects using only VueJS and everything working fine.

Help! Thanks in advance!

Taha Paksu
  • 15,371
  • 2
  • 44
  • 78
  • 1
    I recommend the reading of https://stackoverflow.com/questions/53516594/why-do-i-keep-getting-delete-cr-prettier-prettier?r=SearchResults&s=1|315.4737 – Cláudio Jan 23 '21 at 23:54

3 Answers3

3

In the root open the .editorconfig file and change:

end_of_line = lf

to

end_of_line = auto

This should fix it for new files.

Kevin T
  • 196
  • 1
  • 4
0

to resolve this issue, use below command

yarn lint --fix

if you have not installed yarn yet then install the yarn first.

Mahamudul Hasan
  • 2,745
  • 2
  • 17
  • 26
0

So I was getting the error when I tried to commit. I did this and it skipped the verification:

git commit -m "" --no-verify

I also followed this for VSCode https://medium.com/@csmunuku/windows-and-linux-eol-sequence-configure-vs-code-and-git-37be98ef71df

VS Code => Settings => Files: EoL And choose “\n” as EoL character if you would like your files to have Unix Style line endings and choose “\r\n” if you would like your files to have Windows Style line endings.

G.Okolo
  • 1
  • 2