Skip to content

In JS, both module.exports assignments and property assignments should be allowed in a single file #22461

Closed
@sandersn

Description

@sandersn

Code

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: a.js

// modified from graceful-fs
module.exports = patch
module.exports.close = function (fs$close) {
}
function patch(fs) {
    // do something with Fs
}

Expected behavior:
No errors, and graceful-fs creates a callable module with an exported member patch.

Actual behavior:
Lots of errors, and no exported member patch.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issuecheckJsRelates to checking JavaScript using TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions