Skip to content

[import/extensions] Option to enforce extensions for type-only imports #2530

Open
@trevor-scheer

Description

@trevor-scheer

We have a use case for enforcing the .js extension even on type-only imports (I'm aware this is odd).

This requirement stems from supporting TS users using modules (by specifying "type": "module" in their package.json) and specifying nodenext for moduleResolution options in their tsconfig.

Some context can be gleaned from this PR, where I created a failing test using ^this configuration and proceeded to resolve the errors by adding .js extensions to type-only imports.
apollographql/apollo-server#6731

Related: #2270

Does another option seem reasonable to enforce extensions on type-only imports as well? I'd be happy to open a PR to introduce this if so.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions