How to use prettierrc file on formatting whole files

Viewed 167

I have added prettierrc.json file to my project. so is there a way I can format all the files in the directory with the prettierrc.json config.

If i do prettier --write . it will run the default prettier format, but I want to run the config format which I have mentioned on the .prettierrc.json file.

So any help is appreciated

I have added a sample .prettierrc.json file

{
  "semi": false,
  "overrides": [
    {
      "files": "*.test.js",
      "options": {
        "semi": true
      }
    },
    {
      "files": ["*.html", "legacy/**/*.js"],
      "options": {
        "tabWidth": 4
      }
    }
  ]
}

So is there way I can mention these file in prettier --write . ?

0 Answers
Related