Skip to content

Incorrect default export in types #228

Description

@sidharthv96

https://arethetypeswrong.github.io/?p=roughjs@4.6.6

Incorrect default export

The resolved types use export default where the JavaScript file appears to use module.exports =. This will cause TypeScript under the node16 module mode to think an extra .default property access is required, but that will likely fail at runtime. These types should use export = instead of export default.

This was a problem in mermaid-js/mermaid#5825, as we had to @ts-ignore all the places where rough was used.

Adding a .default does show the types.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions