Skip to content

Conversation

@asger-semmle
Copy link
Contributor

The TypeScript statement export = X compiles to module.exports = X or equivalent. It can therefore be imported using a non-standard default import. Our handling of non-standard default imports rely on recognizing that an ES2015 module is importing a CommonJS/AMD module, and didn't take this case into account.

TypeScript has a flag --esModuleInterop which makes default imports behave as namespace imports if the target module is not an ES2015 module, and for this purpose, having an export = assignment counts as not being an ES2015 module.

Fixes #1266

@asger-semmle asger-semmle requested a review from a team as a code owner April 23, 2019 12:41
@semmle-qlci semmle-qlci merged commit 060aa8c into github:master Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Javascript FP in js/property-access-on-non-object

3 participants