Prettier shareable config for the UdeS style guide. It can be used to format automatically these files:
- css
- html
- js
- json
- md
- php
- scss
- yaml
npm install prettier prettier-config-udes --save-dev
Edit package.json
:
{
"prettier": "prettier-config-udes",
"scripts": {
"format:prettier": "npm run lint:prettier -- --write",
"lint:prettier": "prettier --ignore-path .gitignore --check '**/*.{css,html,js,json,md,scss,yaml,yml}'"
}
}
If you don't have all these extensions files, you should adjust the extension list for you project. Else, Prettier will output an error:
[error] No files matching the pattern were found: "**/*.css".
If you want to be able to format PHP files, you must extend our PHP Prettier configuration by editing your package.json:
{
"prettier": "prettier-config-udes/php",
"scripts": {
"format:prettier": "prettier --ignore-path .gitignore --write '**/*.{css,html,js,json,md,php,scss,yaml,yml}'",
"lint:prettier": "prettier --ignore-path .gitignore --check '**/*.{css,html,js,json,md,php,scss,yaml,yml}'"
}
}
Increment the version
defined in the package.json
file and run the command below to publish the module in the
registry:
# Dry run
npm publish --dry-run
# For real (are you really sure?)
npm publish
The MIT License (MIT)