Graphql-code-generator: Add linters ignore line by default

Created on 12 May 2019  路  3Comments  路  Source: dotansimha/graphql-code-generator

Most helpful comment

Similar to @mehmetnyarar https://github.com/dotansimha/graphql-code-generator/issues/1786#issuecomment-491572790
I currently use the add plugin to add any lint ignore lines. This works well and people can choose the level of linting or ignore they want.

generates:
  src/generated/generated-models.tsx:
    plugins:
      - add: "// tslint:disable max-line-length"
      - add: "// tslint:disable no-namespace"
      - add: "// tslint:disable max-classes-per-file"
      - add: "// tslint:disable trailing-comma"
      - add: "// tslint:disable no-string-literal"
      - add: "// tslint:disable no-shadowed-variable array-type"
      # - add: '/* eslint-disable */'
      - "typescript"
      - "typescript-operations"
      - "typescript-react-apollo"

All 3 comments

Similar to @mehmetnyarar https://github.com/dotansimha/graphql-code-generator/issues/1786#issuecomment-491572790
I currently use the add plugin to add any lint ignore lines. This works well and people can choose the level of linting or ignore they want.

generates:
  src/generated/generated-models.tsx:
    plugins:
      - add: "// tslint:disable max-line-length"
      - add: "// tslint:disable no-namespace"
      - add: "// tslint:disable max-classes-per-file"
      - add: "// tslint:disable trailing-comma"
      - add: "// tslint:disable no-string-literal"
      - add: "// tslint:disable no-shadowed-variable array-type"
      # - add: '/* eslint-disable */'
      - "typescript"
      - "typescript-operations"
      - "typescript-react-apollo"

I've used the add plugin and indeed I see the additional linter exceptions added to the generated file, but I still cannot compile the project as it gives me the same error.

We decided to leave it as-is, because of the complexity of finding out which linter is in use. Just use add plugin.

Was this page helpful?
0 / 5 - 0 ratings