@husldigital/prettier-config
v2.0.1
Published
The HUSL Digital Prettier shared configuration.
Maintainers
Readme
HUSL Prettier Config
HUSL Prettier shareable config for Prettier.
Installation
Install the module
$ npm install prettier @prettier/plugin-php @husldigital/prettier-config --save-devNote: This package requires Node.js 18.0.0 or later.
Usage
- Make sure you installed all the dependencies in the
package.jsonfile:
"@husldigital/prettier-config": "^2.0.0",
"@prettier/plugin-php": "^0.22.0",
"prettier": "^3.0.0"- Create a new file called
.prettierrc.jsand add this to file:
module.exports = require("@husldigital/prettier-config");Or for ESM projects, create .prettierrc.mjs:
import config from "@husldigital/prettier-config";
export default config;Restart your editor and you should be all set.
If you are using VSCode, you may need to install the Prettier - Code formatter extension.
Migration from v1.x
Breaking changes in v2.0.0:
- Requires Prettier 3.x (not compatible with Prettier 2)
- Requires Node.js 18+
- Requires @prettier/plugin-php 0.22.0+
trailingCommachanged from"es5"to"all"phpVersionchanged from"7.4"to"8.2"- Removed invalid
braceStyleoption
Not working?
If you're having issues installing this package try to reinstall everything:
$ rm package-lock.json
$ rm -rf node_modules/
$ npm install
$ npm install prettier @prettier/plugin-php @husldigital/prettier-config --save-devIf you're still having issues send me a message via Slack or email me at [email protected].
