How can I tell Prettier to ignore the package.json file?

I use a more beautiful standard because the project uses the standard for casting.

Following a more attractive pre-commit compilation example . However, I would like to ignore the package.json file. I tried adding package.jsona .prettierignore to the file, but that didn't work.

The code is from a more beautiful pre-commit binding example that I use in my package. json

{
  "scripts": {
    "precommit": "lint-staged"
  },
  "lint-staged": {
     "*.{js,json,css}": [
       "prettier --write",
       "git add"
     ]
  }
}

`` ``

+4
source share
1 answer

You can also use the file .prettierignore.

See the most beautiful project for reference.

+1
source

Source: https://habr.com/ru/post/1686355/


All Articles