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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefer-dom-node-dataset: Remove broken fix for element.setAttribute #2169

Merged
merged 5 commits into from Jul 10, 2023

Conversation

fisker
Copy link
Collaborator

@fisker fisker commented Jul 10, 2023

Previously, we fix

optional?.element.setAttribute("data-unicorn", "馃");

to

optional?.element.dataset.unicorn = "馃";

This is invalid code.

@fisker fisker marked this pull request as draft July 10, 2023 13:10
Comment on lines +16 to +20
// `foo?.bar = ''` is invalid
// TODO: Remove this restriction if https://github.com/nicolo-ribaudo/ecma262/pull/4 get merged
if (method === 'setAttribute' && hasOptionalChainElement(callExpression.callee)) {
return;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the actual change.

@fisker fisker marked this pull request as ready for review July 10, 2023 16:31
@sindresorhus sindresorhus merged commit 61234af into sindresorhus:main Jul 10, 2023
19 of 20 checks passed
@fisker fisker deleted the optional-setter branch July 11, 2023 03:10
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.

None yet

2 participants