简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM