You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Breaking: Defining prettier options must use an object
Drop support for specifying prettier options using the "fb" shorthand
string. Replace "fb" with either config in your .prettierrc or the object:
`{ singleQuote: true, trailingComma: 'all', bracketSpacing: false, jsxBracketSameLine: true, parser: 'flow'}`
Drop support for specifying the prettier options as `null`. Replace
`null` with an empty object `{}`
Copy file name to clipboardExpand all lines: README.md
+11-28Lines changed: 11 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,17 +60,17 @@ To integrate this plugin with `eslint-config-prettier`, you can use the `"recomm
60
60
61
61
1. In addition to the above installation instructions, install `eslint-config-prettier`:
62
62
63
-
```sh
64
-
npm install --save-dev eslint-config-prettier
65
-
```
63
+
```sh
64
+
npm install --save-dev eslint-config-prettier
65
+
```
66
66
67
67
2. Then you need to add `plugin:prettier/recommended` as the last extension in your `.eslintrc.json`:
68
68
69
-
```json
70
-
{
71
-
"extends": ["plugin:prettier/recommended"]
72
-
}
73
-
```
69
+
```json
70
+
{
71
+
"extends": ["plugin:prettier/recommended"]
72
+
}
73
+
```
74
74
75
75
This does three things:
76
76
@@ -101,39 +101,22 @@ For the list of every available exclusion rule set, please see the [readme of es
101
101
102
102
- The first option:
103
103
104
-
- Objects are passed directly to Prettier as [options](https://prettier.io/docs/en/options.html). Example:
104
+
-An object representing [options](https://prettier.io/docs/en/options.html) that will be passed into prettier. Example:
- Or the string `"fb"` may be used to set"Facebook style" defaults:
111
-
112
-
```json
113
-
"prettier/prettier": ["error", "fb"]
114
-
```
115
-
116
-
Equivalent to:
117
-
118
-
```json
119
-
"prettier/prettier": ["error", {
120
-
"singleQuote": true,
121
-
"trailingComma": "all",
122
-
"bracketSpacing": false,
123
-
"jsxBracketSameLine": true,
124
-
"parser": "flow"
125
-
}]
126
-
```
127
-
128
110
NB: This option will merge and override any config set with `.prettierrc` files
129
111
130
112
- The second option:
131
113
132
114
- An object with the following options
115
+
133
116
- `usePrettierrc`: Enables loading of the Prettier configuration file, (default: `true`). May be useful if you are using multiple tools that conflict with each other, or do not wish to mix your ESLint settings with your Prettier configuration.
0 commit comments