Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefer-spread: Mention prefer-object-spread rule in docs #1504

Conversation

tristanHessell
Copy link
Contributor

Fixes: #1065.

@@ -1,6 +1,6 @@
# Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#slice()` and `String#split('')`

Enforces the use of [the spread operator (`...`)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax) over
Enforces the use of [the spread operator (``)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax) over
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect. The spread operator is three dots.

@@ -24,6 +24,8 @@ Enforces the use of [the spread operator (`...`)](https://developer.mozilla.org/

Note: [The suggestion fix may get different result](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402).

For enforcement of the spread operator over `Object#assign()` use the built-in rule [prefer-object-spread](https://eslint.org/docs/rules/prefer-object-spread).
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a comma

@sindresorhus sindresorhus changed the title prefer-spread: add docs reference to prefer-object-spread rules prefer-spread: Mention prefer-object-spread rule in docs Sep 5, 2021
@sindresorhus sindresorhus merged commit b958745 into sindresorhus:main Sep 5, 2021
manovotny pushed a commit to manovotny/eslint-plugin-unicorn that referenced this pull request Sep 21, 2021
…orhus#1504)

Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disallow Object.assign({}, ...) by prefer-spread
2 participants