Skip to content

Enable the .js and .es file extensions for TypeScript files #2302

Closed
@marinasundstrom

Description

@marinasundstrom

Enable the .js, .jsx, .es and .es6 file extensions for TS compiler file inputs and module imports. This is already supported by other transpilers, such as babel.

The feature would ideally be added as an option in the compiler. With .js together with .ts on by default, but .ts still being prefered.

This would cause the files with the enabled extensions to, just as .ts-files today, be processed (e.g. in and IDE), and transformed if the options so allow it.

One objection to this would be that this could potentially confuse scripts that are using TypeScript-specific features with scripts using official ES6 features. I don't personaly see this as an issue. It is up to the developers to come up with conventions in their own projects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions