Skip to content

In JS, aliasing exports = {} omits the expected string index signature #25687

Closed
@sandersn

Description

@sandersn

From adonis-framework in the user tests.

// Filename: util.js
const util = exports = module.exports = {}
util.existy = function() { }

Expected behavior:

No error, and import('util') has a property existy. (Ideally util would also have a property existy inside util.js, but this is not true in 2.9.2 either.)

Actual behavior:

Error: Property 'x' does not exist on type '{}', but require('util') does have a property existy: () => void.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions