Skip to content

Consistently ignore attributes with hyphenated names in JSX #44873

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

Merged
merged 5 commits into from
Jul 6, 2021
Merged

Conversation

ahejlsberg
Copy link
Member

This PR fixes the strange error elaboration behavior seen in #44797. The PR does not introduce validation of attributes with hyphenated names in the presence of index signatures, and attributes with hyphenated names are still ignored in excess property checking.

@@ -26585,8 +26585,8 @@ namespace ts {
return getJsxElementTypeAt(node) || anyType;
}

function isUnhyphenatedJsxName(name: string | __String) {
return !stringContains(name as string, "-");
function isHyphenatedJsxName(name: string | __String) {
Copy link
Member

Choose a reason for hiding this comment

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

👍

@DanielRosenwasser
Copy link
Member

You'll need to accept baselines.


declare function Yadda(props: Props): JSX.Element;
~~~
!!! error TS2503: Cannot find namespace 'JSX'.
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to be React.JSX.Element?

@ahejlsberg ahejlsberg merged commit 8e01a86 into main Jul 6, 2021
@ahejlsberg ahejlsberg deleted the fix44797 branch July 6, 2021 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants