0.2.1 • Published 1 month ago
@cyrilolanolan/prettier-config v0.2.1
@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 prettier
Extend 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
JSON
config:"@cyrilolanolan/prettier-config"
or add
prettier
key 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" |
⚠️ Gotcha!
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
).