v2.1.0
Add Prettier Script Utility
Overview
This PR adds a new utility script that automates Prettier setup for projects using our ESLint configuration. The script simplifies the process of adding Prettier to a project by automatically configuring necessary files and adding npm scripts.
Changes
- Added a new script utility (
bin/add-prettier-scripts.js) that:- Adds
prettier:checkandprettier:writenpm scripts to the project's package.json - Creates a
.prettierrc.jsfile that extends our shared configuration - Creates a
.prettierignorefile with sensible defaults - Installs Prettier as a dependency if not already installed
- Adds
- Added a bin entry in package.json for easy script access
- Updated README documentation with detailed instructions on using the script
- Incremented package version to 2.1.0
How to Use
After this package is installed, users can set up Prettier by running:
npx @hs-web-team/eslint-config-node/bin/add-prettier-scripts.jsTesting
- Manually verified script execution in a test project
- Confirmed all generated files are created with correct content
- Verified npm scripts properly run Prettier checks and formatting