Skip to content

Commit

Permalink
docs: add missing backticks to prefer-object-spread (#19206)
Browse files Browse the repository at this point in the history
  • Loading branch information
lumirlumir authored Dec 3, 2024
1 parent 8a941cb commit b950c1b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/src/_data/rules_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -2640,7 +2640,7 @@
"prefer-object-spread": {
"type": "suggestion",
"docs": {
"description": "Disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead",
"description": "Disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead",
"recommended": false,
"url": "https://eslint.org/docs/latest/rules/prefer-object-spread"
},
Expand Down
2 changes: 1 addition & 1 deletion docs/src/rules/prefer-object-spread.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rule_type: suggestion



When Object.assign is called using an object literal as the first argument, this rule requires using the object spread syntax instead. This rule also warns on cases where an `Object.assign` call is made using a single argument that is an object literal, in this case, the `Object.assign` call is not needed.
When `Object.assign` is called using an object literal as the first argument, this rule requires using the object spread syntax instead. This rule also warns on cases where an `Object.assign` call is made using a single argument that is an object literal, in this case, the `Object.assign` call is not needed.

Introduced in ES2018, object spread is a declarative alternative which may perform better than the more dynamic, imperative `Object.assign`.

Expand Down
4 changes: 2 additions & 2 deletions lib/rules/prefer-object-spread.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @fileoverview Prefers object spread property over Object.assign
* @fileoverview Rule to disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead
* @author Sharmila Jesupaul
*/

Expand Down Expand Up @@ -246,7 +246,7 @@ module.exports = {

docs: {
description:
"Disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead",
"Disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead",
recommended: false,
url: "https://eslint.org/docs/latest/rules/prefer-object-spread"
},
Expand Down

0 comments on commit b950c1b

Please sign in to comment.