graphql-binding / graphql-static-binding

Generate static binding files for a GraphQL schema
MIT License
24 stars 7 forks source link

Add TSLint:Disable to generated/graphcool.ts #32

Closed kbrandwijk closed 6 years ago

kbrandwijk commented 6 years ago

From @philcockfield on January 8, 2018 17:48

With GraphCool 1.0 a TypeScript file is generated locally after deploy:

/src/generated/graphcool.ts

This produces typescript that may conflict with the projects tslint.json rules. Can you include a

// tslint:disable

directive at the top of the generated file to exclude it from the projects linting output, please?

Thanks.

Copied from original issue: graphcool/graphcool#1543

kbrandwijk commented 6 years ago

TSLint also offers a configuration option to ignore a certain folder (in this case: generated), either using the --exclude command line option, of the exclude node in your tsconfig.json.

I think that would be a better solution than adding these types of statements to the files.Tslint is not the only linter out there, and I don't want to end up with 10 different ignore statements in my generated files.

philcockfield commented 6 years ago

Yeah, that's probably better given your rationale of there being more than one linter out there.

philcockfield commented 6 years ago

exclude node in your tsconfig.json

That wouldn't work - as you actually want the files to be transpiled, just not linted. I've added an --exclude to the tslint command.

kbrandwijk commented 6 years ago

@philcockfield Sorry, I meant tslint.json not tsconfig.json...

"cliOptions": {
  "exclude": [
    "src/generated",
  ]
}
kbrandwijk commented 6 years ago

Closing this, as the alternative to configure this for tslint is known, and I'm not going to put something in the generated file.