Skip to content

[REQ] [typescript] exported namespace in Typescript conflicts with ESlint #21576

@RVledder

Description

@RVledder

By default, the models that get exported contain a namespace.

interface SomeModel { ... }
export namespace SomeModel {} // here

Is this by design?

ESLint has a no-namespace rule. That suggests that many TypeScript projects have no use for the exported namespace and thus fail to compile.

So, what is the reason to export it?

Was it perhaps initially for Angular 1 projects and environments that use AMD/CommonJS modules?

Possible feature

It could be removed from the default mustache file and thus the export. This would mean a backward incompatible API change for this openapi-generator library. And therefore a major upgrade version probably.

Another option would be to add it in the additional-properties, like:

npx openapi-generator-cli generate  -g typescript-angular --global-property models,supportingFiles additional-properties= noNamespaces=false

This is an addition and would not require a major version update of this project.

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