Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6be36c9

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

File tree

1 file changed

+5
-7
lines changed
Filter options

1 file changed

+5
-7
lines changed

‎docs/src/extend/custom-rules.md

Copy file name to clipboardExpand all lines: docs/src/extend/custom-rules.md
+5-7Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.