Skip to content

[Suggestion] Drop .ext and code duplication in js+ts files #1119

@michaelw85

Description

@michaelw85

I'm submitting a suggestion to improve cli maintainability

  1. The CLI skeletons contains .ext files to be able to flexibly change the output to either JS or TS based on choices made by the developer setting up a new project.

Although this is a great concept it has some drawbacks.

  • IDE does not know what to do with these files (work around: manually setting file type)
  • Linter don't work on these files
  • Not unit testable, files cannot be required as-is
  • These files are never properly setup for TS since the typings would not work in a JS output which leads me to:
  1. When we want to add a proper TS file with typings to a skeleton we have a JS and TS variant in a skeleton. This results in duplicate code and maintenance, it easy to forgot one or the other.

Suggestion
If #1067 is completed a transpiler is introduced.
We could change all skeletons to a TS setup, this would give the TS users properly typed files and for the JS users we could simply transpile these files. This would remove duplicate code and would provide a normal development experience in the IDE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions