mirror of
https://github.com/Mastermindzh/code-style-conventions.git
synced 2025-09-21 07:30:13 +02:00
first version
This commit is contained in:
47
README.md
47
README.md
@@ -1,2 +1,45 @@
|
||||
# prettier-config
|
||||
My preferred prettier config
|
||||
# @mastermindzh/prettier-config
|
||||
|
||||
My preferred prettier configuration.
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
- [Installation](#installation)
|
||||
- [Configuration](#configuration)
|
||||
- [package.json](#packagejson)
|
||||
- [.prettierrc.js](#prettierrcjs)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
## Installation
|
||||
|
||||
Simply install the package with npm:
|
||||
|
||||
`npm install --save-dev @mastermindzh/prettier-config`
|
||||
|
||||
## Configuration
|
||||
|
||||
Configuring your project to use `@mastermindzh/prettier-config` can be done in several ways.
|
||||
The easiest is the [package.json](#packagejson) solution, the most extensible is the [.prettierrc.js](#prettierrcjs) version.
|
||||
|
||||
### package.json
|
||||
|
||||
Simply add a "prettier" key with the package name:
|
||||
|
||||
```json
|
||||
{
|
||||
"prettier": "@mastermindzh/prettier-config"
|
||||
}
|
||||
```
|
||||
|
||||
### .prettierrc.js
|
||||
|
||||
This solution requires you to put a `.prettierrc.js` file at the root of your project with the following code:
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
...require("@mastermindzh/prettier-config"),
|
||||
// optional overrides:
|
||||
jsxBracketSameLine: true
|
||||
};
|
||||
```
|
||||
|
Reference in New Issue
Block a user