Generate .prettierrc file

Viewed 15594

I found this file .prettierrc inside a project. I would like to know how to generate it from visual studio code. Or I just create a new file named .prettierrc?

I tried to find something on internet but i am still confused

2 Answers

Here is the documentation.

If you go to the package.json file in your project, you probably will see that prettier is listed on the devDependencies.

As you can see in the documentation, you'll have to install it within your node project with:

npm install --save-dev --save-exact prettier

and then create the file manually with:

echo {}> .prettierrc.json

After that, you just need to configure it with your preferences. Check this examples.

Keep in mind that one common usage of prettier, is using it integrated it with linters. Check this documentation as well.

in terminal type

npm install prettier

then type

type nul > .prettier

to create its configuration file if it doesn't work just remove the space between > and .

Related