@matterlabs/prettier-config
v1.0.3
Published
This package provides Matter Labs' shared configuration for Prettier, ensuring a consistent coding style across projects
Downloads
18,567
Readme
@matterlabs/prettier-config
This package provides Matter Labs' shared configuration for Prettier, ensuring a consistent coding style across projects.
📦 Installation
npm i -D @matterlabs/prettier-config
OR
yarn add --dev @matterlabs/prettier-config
🚀 Usage
Update your package.json
:
{
...
"prettier": "@matterlabs/prettier-config"
...
}
OR
Update your .prettierrc.js
or prettier.config.js
file in the root of your project:
module.exports = {
...require('my-prettier-config'),
// you can override or extend the config here if needed
};
📜 Rules Overview
Here's a quick overview of some of the primary rules:
- Print Width: Maximum of 120 characters.
- Tabs: Spaces are used over tabs.
- Tab Width: 2 spaces for each indentation level.
- Semicolons: Always required at the end of statements.
- Trailing Commas: ES5 style. This means trailing commas are used for multiline object and array literals, but not for function parameters or arguments.
- Quotes: Double quotes are mandatory, including for JSX.
- Bracket Spacing: Spaces between brackets in object literals.
For a detailed list of all rules and configuration details, please refer to the source configuration.
🙌 Contributing
If you find any issues or have suggestions, feel free to open an issue or a pull request in the repository.
📜 License
This project is licensed under MIT and APACHE 2.0.