-
Notifications
You must be signed in to change notification settings - Fork 540
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
Implement containerSeemsToBeEmptyDomElement
(regex free)
#691
Merged
jakebailey
merged 6 commits into
microsoft:main
from
frodi-karlsson:implement-empty-dom-element
Mar 23, 2025
+48
−44
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
19fb987
Implement `containerSeemsToBeEmptyDomElement` (regex free)
frodi-karlsson 061e670
Add missing "Element" check
frodi-karlsson 3668686
Use correct dom lib name
frodi-karlsson d3fdd9c
Revert dom change and add missing a-zA-Z check
frodi-karlsson 1a84d8d
Revert revert of lib.dom
frodi-karlsson 8d19fa7
Clean up solution with CutPre/Suffix and isAsciiLetter
frodi-karlsson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
testdata/baselines/reference/submodule/compiler/missingDomElements.errors.txt.diff
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'm now concerned about this due to #593 (comment) showing that our config parser doesn't actually include "dom" as the output here. Maybe that PR was wrong even though it really seemed right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see (sort of...), but removing
slices.Contains(c.compilerOptions.Lib, "dom")
yields no test diff, so I think perhaps this doesn't disprove that comment and this could be wrongThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran a quick test showing that comment to also apply for dom, just to be sure
I wouldn't say that test should be included, since we're already testing the same thing in the compiler tsconfig test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the original code matched only "dom", then I'm just trying to figure out if this means config parsing is still wrong. Not necessarily that your PR was wrong originally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've revert back to the Strada-like check for now, as a default until we know more there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, yeah, so this code in strada has always been broken.
I modified strada to print
compilerOptions.lib
when this function is called, and the tests print lines like:So
!compilerOptions.lib.includes("dom")
is always true. 😆There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being a bit unsure what to do, I opened an issue here microsoft/TypeScript#61466 and re-implemented the fixed version here