@@ -126,21 +126,15 @@ eslint-config-prettier also ships with a little CLI tool to help you check if
126
126
your configuration contains any rules that are unnecessary or conflict with
127
127
Prettier.
128
128
129
- First, add a script for it to package.json :
129
+ You can run it using ` npx ` :
130
130
131
- <!-- prettier-ignore -->
132
- ``` json
133
- {
134
- "scripts" : {
135
- "eslint-check" : " eslint --print-config path/to/main.js | eslint-config-prettier-check"
136
- }
137
- }
131
+ ```
132
+ npx eslint --print-config path/to/main.js | npx eslint-config-prettier-check
138
133
```
139
134
140
- Then run ` npm run eslint-check ` . (Change ` path/to/main.js ` to a file that
141
- exists in your project.)
135
+ (Change ` path/to/main.js ` to a file that exists in your project.)
142
136
143
- In theory you need to run ` eslint --print-config file.js | eslint-config-prettier-check ` for every single file in your project to be
137
+ In theory you need to run ` npx eslint --print-config file.js | npx eslint-config-prettier-check` for every single file in your project to be
144
138
100% sure that there are no conflicting rules, because ESLint supports having
145
139
different rules for different files. But usually you’ll have about the same
146
140
rules for all files, so it is enough to run the command on one file (pick one
@@ -149,9 +143,9 @@ that you won’t be moving). If you use [multiple configuration files] or
149
143
several times with different ` --print-config ` arguments, such as:
150
144
151
145
```
152
- eslint --print-config index.js | eslint-config-prettier-check
153
- eslint --print-config test/index.js | eslint-config-prettier-check
154
- eslint --print-config legacy/main.js | eslint-config-prettier-check
146
+ npx eslint --print-config index.js | npx eslint-config-prettier-check
147
+ npx eslint --print-config test/index.js | npx eslint-config-prettier-check
148
+ npx eslint --print-config legacy/main.js | npx eslint-config-prettier-check
155
149
```
156
150
157
151
Exit codes:
0 commit comments