Skip to content

Override Node nextSibling to be type of ChildNode. #619

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 1 commit into from
Jan 18, 2019

Conversation

Fabianopb
Copy link
Contributor

As discussed in microsoft/TypeScript#28551 a Node's nextSibling should have type of ChildNode so types can match when comparing or assigning elements.

I've noticed also nextSibling present in the interface MutationRecord here and in the interface TreeWalker as a method here.

Not sure about those other two occurrences, but at least it seems consistent the change in Node. Let me know if you guys have any comment!

Cheers!

@Fabianopb
Copy link
Contributor Author

Friendly ping @weswigham who added the related issue to https://github.com/Microsoft/TypeScript/milestone/2 some days ago! I'd be happy if someone could give a feedback! :)

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

Seems like a reasonable improvement even if it's not completely as accurate as @saschanaz' suggestion.

@drivron
Copy link
Contributor

drivron commented Jul 26, 2019

The type of previousSibling should be modified accordingly ...

@jcormont
Copy link

I agree, ran into this recently as well. Open a new issue...?

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.

4 participants