Search code examples
javascriptnode.jspackage.jsonprettier

Should package.json be included in .prettierignore file?


Configuring Prettier for the first time and I understand that things like build/deploy files and node_modules (obviously) should be ignored, as well as auto-generated files like package-lock.json. What about package.json? It's partially auto generated but people also go in and edit it manually, so I think there is value in running Prettier on it. Any other best practices for what to include/not include in the ignore file? I'm assuming submodules should be left in once Prettier has been run on the submodule.


Solution

  • I would recommended to allow prettier and other linters to read/lint package.json.

    You want to keep things tidy and consistent. Rule of thumb is if it's not autogenerated then go ahead.