Skip to content

Commit 6be36c9

Browse files
authored
docs: Update custom-rules.md code example of fixer (#19555)
1 parent 2aaadce commit 6be36c9

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

docs/src/extend/custom-rules.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -329,15 +329,13 @@ Best practices for fixes:
329329
- For example, suppose a fixer would like to surround an object key with quotes, but it's not sure whether the user would prefer single or double quotes.
330330

331331
```js
332-
({ foo: 1 })(
333-
// should get fixed to either
332+
{ foo: 1 }
334333

335-
{ foo: 1 },
336-
)(
337-
// or
334+
// should get fixed to either
335+
{ 'foo': 1 }
338336

339-
{ foo: 1 },
340-
);
337+
// or
338+
{ "foo": 1 }
341339
```
342340

343341
- This fixer can just select a quote type arbitrarily. If it guesses wrong, the resulting code will be automatically reported and fixed by the [`quotes`](../rules/quotes) rule.

0 commit comments

Comments
 (0)