Skip to content

Conversation

mdjermanovic
Copy link
Member

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

Closes #12048

What changes did you make? (Give an overview)

This PR documents that no-useless-computed-key also applies to object patterns. I added several tests to confirm the behavior.

Is there anything you'd like reviewers to focus on?

['__proto__'] in object patterns is a false negative. Shall we fix it or leave the behavior as is?

@mdjermanovic mdjermanovic requested a review from a team as a code owner November 6, 2024 16:11
@eslint-github-bot eslint-github-bot bot added the documentation Relates to ESLint's documentation label Nov 6, 2024
@mdjermanovic mdjermanovic added rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion labels Nov 6, 2024
Copy link

netlify bot commented Nov 6, 2024

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit 74f313f
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/672b95267f2a7e0008c9683e
😎 Deploy Preview https://deploy-preview-19109--docs-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@fasttime
Copy link
Member

fasttime commented Nov 7, 2024

['__proto__'] in object patterns is a false negative. Shall we fix it or leave the behavior as is?

This seems to be a bug introduced with #7934. Apparently it wasn't considered that the rule also applies to object patterns at the time of that change. I think it should be fixed as per our policy. @nzakas what do you think?

@nzakas
Copy link
Member

nzakas commented Nov 12, 2024

I agree, let's fix it. I'm assuming that would be a separate PR?

@mdjermanovic
Copy link
Member Author

I'm assuming that would be a separate PR?

Yes, it seems better to fix that in a separate PR so that this one just documents the existing behavior.

Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@fasttime fasttime merged commit 39089c8 into main Nov 13, 2024
27 checks passed
@fasttime fasttime deleted the issue12048 branch November 13, 2024 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted There is consensus among the team that this change meets the criteria for inclusion documentation Relates to ESLint's documentation rule Relates to ESLint's core rules

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

key/property rules and ObjectPattern

3 participants