Package Exports
- @tiagoporto/prettier-config
Readme
@tiagoporto/prettier-config
Shareable Config for Prettier
Installation
npm install --save-dev prettier @tiagoporto/prettier-configUsage
// .prettierrc.mjs
import tpConfig from '@tiagoporto/prettier-config'
export default tpConfigIn package.json add the following scripts:
{
"scripts": {
"format:check": "prettier --check --ignore-unknown \"**/*\"",
"format": "npm run format:check -- --write"
}
}Lint-staged
Check staged files
// .lintstagedrc.mjs
export default {
'*': 'prettier --check --ignore-unknown --write'
}Editor
For VSCode is recommended the following extensions:
// .vscode/settings.json
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}License
@tiagoporto/prettier-config © 2024 by Tiago Porto is licensed under MIT License.