-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Alias for commonjs require in JS #39770
Merged
Merged
Changes from 27 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
4f9ccd0
First attempt at aliases for require
sandersn d692387
Merge branch 'master' into alias-for-require
sandersn 277d52a
test+initial support for const x=require
sandersn bcdc2e4
1st round of baseline improvements
sandersn 20aa6ed
2nd round of baseline updates
sandersn f213707
support property access after require
sandersn 122babd
check @type tag on require
sandersn f32ec4e
Merge branch 'master' into alias-for-require
sandersn e1e32af
forbid expando missing namespaces on aliases
sandersn 4ddb3d0
accept error baselines that are good, actually
sandersn 58a0b65
Scribbling on d.ts emit code
sandersn d885b67
use getSpecifierForModuleSymbol
sandersn 5a0b092
hideous hack for module.exports of aliases
sandersn 64c8c86
Merge branch 'master' into alias-for-require
sandersn 55a13b7
Fix module.exports.x --> export list emit
sandersn 7ce7c8c
fix isLocalImport predicate
sandersn ca5a57b
require only creates aliases in JS
sandersn e9a355d
re-handle json imports
sandersn febcf0e
update fourslash baseline
sandersn 3ee9b6f
Cleanup in the checker
sandersn a671b45
Function for getting module name from require call
sandersn 6dfbec3
Merge branch 'master' into alias-for-require
sandersn 0c92277
First round of cleanup plus a new test
sandersn dee0561
more small cleanup
sandersn e32df83
more cleanup, including lint
sandersn f4b5124
use trackSymbol, not serializeTypeForDeclaration
sandersn a841988
Merge branch 'master' into alias-for-require
sandersn 0694890
Merge branch 'master' into alias-for-require
sandersn 781bec2
Code review comments, plus remove unneeded code
sandersn 2bfeeeb
find all refs works
sandersn 0ba0d90
Merge branch 'master' into alias-for-require
sandersn 62e5b18
remove old ad-hoc code
sandersn 2679b03
make it clear that old behaviour is not that correct
sandersn 03fb2d4
update api baselines
sandersn 7aeb306
remove outdated comment
sandersn d2c0b3c
Merge branch 'master' into alias-for-require
sandersn 9d2ce87
Merge branch 'master' into alias-for-require
sandersn 283a520
PR feedback
sandersn 6c7897e
add a fail-case test (which passes!)
sandersn 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
60 changes: 30 additions & 30 deletions
60
tests/baselines/reference/checkOtherObjectAssignProperty.symbols
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
28 changes: 14 additions & 14 deletions
28
tests/baselines/reference/checkOtherObjectAssignProperty.types
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
4 changes: 2 additions & 2 deletions
4
tests/baselines/reference/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types
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.
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.
note that once this works well enough, we could turn it on in TS as well, which would be pretty great.