swagger-api / swagger-api/swagger-codegen

[typescript-angular] Disable tslint in generated files /* tslint:disable */

Open
#6,720 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: TypeScript Enhancement: Code format
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

The generated TS code disables only specific tslint rules:

/* tslint:disable:no-unused-variable member-ordering */

Some other generated files do not disable any tslint rules.

The generated code is causing tslint issues depending on configured rules, such as:

  • " should be '
  • file should end with a newline
  • trailing whitespace
  • Missing semicolon
    etc.
Swagger-codegen version

2.3.0 - swagger-codegen-cli-2.3.0-20171004.083430-178

Steps to reproduce
  • tslint.json:
    "semicolon": [ true, "always" ],
  • generate an api client
  • Run ng lint
Suggest a fix/enhancement

Simple fix would be to disable all tslint rules in generated files:

/* tslint:disable */

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TypeScript Angular generator and the generated files produced by the reproduction using the shown tslint.json and ng lint steps. Verify which generated files contain partial or missing TSLint directives, then confirm that generated output no longer reports the listed configured-rule violations.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.