Skip to content

[REQ] add /* eslint-disable */ to JS/TypeScript files #3814

@ash-r1

Description

@ash-r1

Is your feature request related to a problem? Please describe.

I'm using open-api-generator with create-react-app / typescript.

I generated dead simple API by below command:
openapi-generator generate -i openapi.yml -g typescript-axios -o ./src/api-client

Then, executed yarn start command, It shows warning:

Compiled with warnings.

./src/api-client/base.ts
  Line 17:  'AxiosPromise' is defined but never used  @typescript-eslint/no-unused-vars

./src/api-client/api.ts
  Line 19:  'COLLECTION_FORMATS' is defined but never used  @typescript-eslint/no-unused-vars

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

I feel these generated codes shouldn't be lint-ed.

Describe the solution you'd like

Just add /* eslint-disable */ to top of the generated .js/.ts files.

Additional context

Currently, Create React App(CRA) doesn't follow .eslintignore.
facebook/create-react-app#2339

CRA & eslint is one of the most popular tools to develop JS/TS frontend.
I feel this feature is reasonable.

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