@nbry/prettier-config
v1.0.0
Published
Prettier shareable config with opinionated defaults
Maintainers
Readme
@nbry/prettier-config
Prettier shareable config with opinionated defaults for consistent code formatting.
Installation
npm install --save-dev @nbry/prettier-config prettieror with yarn:
yarn add -D @nbry/prettier-config prettierUsage
Add this to your package.json:
{
"prettier": "@nbry/prettier-config"
}Or create a .prettierrc.js file:
module.exports = require('@nbry/prettier-config');Or extend it in .prettierrc.json:
"@nbry/prettier-config"Configuration
This config includes:
- 100 character line length
- 2 spaces for indentation
- Single quotes for strings
- Semicolons required
- ES5 trailing commas
- LF line endings
- Arrow function parens always included
Customization
You can override any options by creating a .prettierrc.js:
module.exports = {
...require('@nbry/prettier-config'),
printWidth: 120, // Override line length
singleQuote: false, // Use double quotes
};Editor Integration
VS Code
Install the Prettier extension and add to your settings:
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}License
MIT
