0.2.2 • Published 1 year ago
@cyrilolanolan/prettier-config v0.2.2
@cyrilolanolan/prettier-config
Prettier configuration for formatting code
This combines defaults with personal style choices to write clean, readable, and consistent codes across all projects.
Installation
Install the package with its peer dependencies:
npm i -D @cyrilolanolan/prettier-config prettierExtend this configuration by using any of these methods:
In your Prettier Configuration (preferred):
// .prettierrc.js const sharedConfig = require('@cyrilolanolan/prettier-config'); module.exports = { ...sharedConfig, // extend or overwrite options here };or if you're using a
JSONconfig:"@cyrilolanolan/prettier-config"or add
prettierkey inside yourpackage.json:{ "prettier": "@cyrilolanolan/prettier-config" }
Configurations
This package extends the handful default Prettier Options and the following API overrides:
| rule | value |
|---|---|
| singleQuote | true |
| tabWidth (for *.py) | 4 |
| trailingComma | "es5" |
⚠️ Gotchas
Extending via package.json or any JSON config
These methods do not offer a way to extend the configuration to overwrite some properties from the shared configuration. To do that, you have to refer to the first installation method (using .prettierrc.js).