Skip to content

I want to write explicit .ts file extension in typescript project, and let the compiled file to have .js extension.Β #55346

Closed
@xieyuheng

Description

@xieyuheng

πŸ” Search Terms

explicit .ts file extension

βœ… Viability Checklist

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals

⭐ Suggestion

Add a config option to write explicit .ts file extension in typescript project, and let the compiled file to have .js extension.

πŸ“ƒ Motivating Example

It feels wrong to import .ts file as .js file in typescript project.

πŸ’» Use Cases

  1. What do you want to use this for?

    I want to write explicit .ts file extension in typescript project, and let the compiled file to have .js extension.

  2. What shortcomings exist with current approaches?

    It feels wrong to import .ts file as .js file in typescript project.

  3. What workarounds are you using in the meantime?

    Write .js file extension in typescript project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions