Before proceeding, ensure nvm (Node Version Manager) and Node.js are installed using the install-nodejs skill.
- •
Create
.prettierrc.jsonin the project root if it doesn't already exist. - •
The content of
.prettierrc.jsonshould at a minimum contain every setting listed below (do not remove any existing setting just ensure these settings all exist and if not add them):json{ "printWidth": 120, "singleQuote": true, "semi": true, "tabWidth": 2, "trailingComma": "none", "endOfLine": "lf" } - •
Create
.prettierignorein the project root if it doesn't already exist. - •
The content of
.prettierignoreshould at a minimum contain every setting listed below (do not remove any existing setting just ensure these settings all exist and if not add them):codenode_modules dist build coverage
- •
If a
package.jsonfile exists in the project root, ensureprettier:fixandprettier:checkare listed asscriptscommand, and if these commands don't exist add them.json"scripts":{ "prettier:fix": "npx prettier --fix ." "prettier:check": "npx prettier --check ." } - •
There is no reason to have prettier configuration or dependency (outside of the two
prettier:fixandprettier:checkscript commands) inpackage.jsonor any other file. If extra prettier configuration exists inpackage.jsonor any other file, remove it to avoid confusion and ensure all configuration is in.prettierrc.jsonand.prettierignore. This also applies to "nested"package.jsonfiles in subdirectories (for example projects that have aclientorcdkdirectory).