Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Check whether the package *actually* has a default #1

Description

@DanielRosenwasser

And emit a message like

This package was declared using `module.exports = ...` or some variant. It should be declared with an `export = ...` like one of the following:

### Variables

```ts
declare var xyz: SomeType;

export = xyz;
```

### Classes

```ts
class Foo {
  // ...
}

export = Foo
```

### Functions

```ts
function foo(): any;

export = foo;
```

You can then import using a more appropriate syntax like

```ts
import foo = require("foo");
```

Alternatively, to import the entity using a default import as follows, you will need to enable `esModuleInterop`.

```ts
import foo from "foo";
```

[See more here in the FAQ](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/9f9f6430117d025aef62ed56128deb65508edc86/README.md#a-package-uses-export--but-i-prefer-to-use-default-imports-can-i-change-export--to-export-default).

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