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
Copy file name to clipboardExpand all lines: README.md
+21-2
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,9 @@ Then, add `"prettier"` to the "extends" array in your `.eslintrc.*` file. Make s
57
57
}
58
58
```
59
59
60
-
That’s it! Extending `"prettier"` turns off a bunch of core ESLint rules, as well as a few rules from these plugins:
60
+
Finally, run the [CLI helper tool](#cli-helper-tool) to find problems in the `"rules"` section of your `.eslintrc.*` file. (Remember, `"rules"` always “wins” over `"extends"`!)
61
+
62
+
Extending `"prettier"` turns off a bunch of core ESLint rules, as well as a few rules from these plugins:
eslint-config-prettier also ships with a little CLI tool to help you check if your configuration contains any rules that are unnecessary or conflict with Prettier.
86
88
89
+
🚨 This example has a **conflicting rule**`"indent"` enabled:
90
+
91
+
<!-- prettier-ignore -->
92
+
```json
93
+
{
94
+
"extends": [
95
+
"some-other-config-you-use",
96
+
"prettier"
97
+
],
98
+
"rules": {
99
+
"indent": "error"
100
+
}
101
+
}
102
+
```
103
+
104
+
While the `"prettier"` config can disable problematic rules in `"some-other-config-you-use"`, it cannot touch `"rules"`! (That’s how ESLint works – it lets you override configs you extend.) The CLI helper tool reports that `"indent"` conflicts with Prettier, so you can remove it. (Which is nice – simplifying your config!)
(Change `path/to/main.js` to a file that exists in your project.)
94
113
95
-
In theory you need to run the tool for every single file in your project to be 100% sure that there are no conflicting rules, because ESLint supports having different rules for different files. But usually you’ll have about the same rules for all files, so it is good enough to run the command on one file. But if you use [multiple configuration files] or [overrides], you can provide several files check:
114
+
In theory you need to run the tool for every single file in your project to be 100% sure that there are no conflicting rules, because ESLint supports having different rules for different files. Usually you’ll have about the same rules for all files, so it is good enough to run the command on one file. But if you use [multiple configuration files] or [overrides], you can provide several files check:
0 commit comments