Skip to content

Commit 735dc4b

Browse files
author
Max Beatty
committed
feat!: simplify config
1 parent bea16e5 commit 735dc4b

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,44 @@ Square's shared [Prettier](https://prettier.io) configuration.
44

55
## Usage
66

7-
**Install**:
7+
### Install
88

99
```sh
10-
$ yarn add --dev @square/prettier-config
10+
npm install --save-dev @square/prettier-config
1111
```
1212

13-
**Edit `package.json`**:
13+
```sh
14+
yarn add --dev @square/prettier-config
15+
```
16+
17+
```sh
18+
pnpm install --dev @square/prettier-config
19+
```
20+
21+
### Configure
22+
23+
Reference the shared configuration in your `package.json` file:
1424

1525
```jsonc
1626
{
17-
// ...
27+
"name": "my-cool-library",
28+
"version": "9000.0.1",
1829
"prettier": "@square/prettier-config"
1930
}
2031
```
2132

22-
[Read more on sharing configurations.](https://prettier.io/docs/en/configuration.html#sharing-configurations)
33+
If you don’t want to use `package.json`, you can use any of the supported extensions to export a string, e.g. `.prettierrc.json`:
34+
35+
```json
36+
"@square/prettier-config"
37+
```
38+
39+
[Read more on Prettier configuration.](https://prettier.io/docs/en/configuration.html)
2340

2441
## Philosophy
2542

2643
> By far the biggest reason for adopting Prettier is to stop all the on-going debates over styles.
2744
>
2845
> [Prettier's Option Philosophy](https://prettier.io/docs/en/option-philosophy.html)
2946
30-
This minimal configuration is intended to provide consistent, automatic formatting throughout a project and pairs well with [eslint-plugin-square](https://github.com/square/eslint-plugin-square).
47+
This minimal, practically nonexistent, configuration is intended to provide consistent, automatic formatting throughout a project.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
"description": "Square's Prettier config",
55
"main": "prettier.json",
66
"repository": "[email protected]:square/prettier-config.git",
7-
"license": "apache-2.0"
7+
"license": "apache-2.0",
8+
"scripts": {
9+
"postversion": "git push && git push --tags"
10+
}
811
}

prettier.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"$schema": "http://json.schemastore.org/prettierrc",
3-
"singleQuote": true
2+
"$schema": "http://json.schemastore.org/prettierrc"
43
}

0 commit comments

Comments
 (0)