jeff-skill-install-prettier
Install prettier. Use when setting up a dev environment, fixing TypeScript and JavaScript formatting issues, or asked to "install prettier", "configure prettier", or "set up code formatting".
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
Before proceeding, ensure nvm (Node Version Manager) and Node.js are installed using the jeff-skill-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):{ "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):node_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."scripts":{ "prettier:fix": "npx prettier --write .", "prettier:check": "npx prettier --check ." } -
If a
package.jsonfile does NOT exist in the project root, create or append to aMakefilewith prettier commands:- If
Makefilealready exists, append the prettier targets to it (only if they don't already exist) - If
Makefiledoesn't exist, create it with the prettier targets
.PHONY: prettier-fix prettier-check prettier-fix: npx prettier --write . prettier-check: npx prettier --check . - If
-
There is no reason to have prettier configuration or dependency (outside of the two
prettier:fixandprettier:checkscript commands in package.json, or the prettier targets in Makefile) 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).
Additional resources
- Refer to the Prettier documentation if you need help: https://prettier.io/docs/
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-03-11
- Index updated
- 2026-03-11
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!