diff --git a/docs/src/_data/rules_meta.json b/docs/src/_data/rules_meta.json index 759132dda27a..73530e3d2d7b 100644 --- a/docs/src/_data/rules_meta.json +++ b/docs/src/_data/rules_meta.json @@ -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" }, diff --git a/docs/src/rules/prefer-object-spread.md b/docs/src/rules/prefer-object-spread.md index b1927350ece1..402926efa713 100644 --- a/docs/src/rules/prefer-object-spread.md +++ b/docs/src/rules/prefer-object-spread.md @@ -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`. diff --git a/lib/rules/prefer-object-spread.js b/lib/rules/prefer-object-spread.js index 60b0c3175c01..a6eb4bd4f6a4 100644 --- a/lib/rules/prefer-object-spread.js +++ b/lib/rules/prefer-object-spread.js @@ -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 */ @@ -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" },