@bedandbreakfast/prettier-config
v1.0.11
Published
Prettier Config
Readme
prettier-config
The Prettier configuration for Bedandbreakfast.eu.
##Usage
Make sure
@bedandbreakfast/prettier-configis available in your project.Install the required dependencies into your project using:
( export PKG=@bedandbreakfast/prettier-config; npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev )This installs the correct version of Prettier as a devDependency.
On Windows this should work using Git for Windows.
Add the following to your
package.json:{ "prettier": "@bedandbreakfast/prettier-config" }If you don't want to use
package.json, use a.prettierrc.jsonthat exports a string:"@bedandbreakfast/prettier-config"Or if you need to extend this config use a
.prettierrc.js:module.exports = { ...require("@bedandbreakfast/prettier-config"), semi: false };
Prettier should now work in PhpStorm, hit Ctrl + Alt + Shift + P to format a file.
Prettier on save
To automatically run Prettier when saving files, use file watchers in PhpStorm:
File > Settings > Tools > File Watchers
Click + and use the build-in Prettier Template, repeat for each filetype you want this for.
