Ensure consistent code formatting in your project with the Wonderfully Consistent Prettier Config package.
To get started, install the package and its peer dependency using npm:
npm install prettier @wonderlandengine/prettier-config --save-dev
Next, integrate the config into your package.json
by adding the following line:
"prettier": "@wonderlandengine/prettier-config"
To make formatting your code even easier, add a script to your package.json
to handle the formatting for you:
"scripts": {
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,md}\""
}
With the script added, you can now format all your files with a simple command:
npm run format