-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unassignable properties by adding undefined with exactOptionalPro…
…pertyTypes (#45032) * Simple first version Doesn't cover or test any complicated variations. * Lots of cases work Destructuring does not. But - skipping node_modules and lib.* does. - call expressions does - property access, including with private identifiers, does * Support variable declarations, property assignments, destructuring As long as it's not nested * More cleanup * skip all d.ts, not just node_modules/lib * Offer a codefix for a lot more cases * remove incorrect tuple check * Use getSymbolId instead of converting to string Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com> * add test + switch to tracking number symbol ids * Address PR comments * Exclude tuples from suggestion * Better way to get error node Plus add a check that errorNode is an argument to the call, not the call's expression. * fix semicolon lint * fix another crash * Simplify: add undefined to all optional propertie whether or not somebody tried to assign undefined to them in the erroneous assignment * remove fix-all Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
- Loading branch information
1 parent
92e7fb5
commit 8d4fe5a
Showing
31 changed files
with
992 additions
and
100 deletions.
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
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
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
Oops, something went wrong.