Mirror: TypeScript LSP plugin that finds GraphQL documents in your code and provides diagnostics, auto-complete and hover-information.

fix: Add prettier/eslint disable comments to output (#199)

authored by kitten.sh and committed by

GitHub acd1317b f413cd78

+10
+5
.changeset/yellow-pianos-explode.md
··· 1 + --- 2 + '@0no-co/graphqlsp': patch 3 + --- 4 + 5 + Automatically disable Prettier and ESLint on `tadaOutputLocation` output files.
+5
packages/graphqlsp/src/graphql/getSchema.ts
··· 14 14 15 15 import { Logger } from '../index'; 16 16 17 + const preambleComments = 18 + ['/* eslint-disable */', '/* prettier-ignore */'].join('\n') + '\n'; 19 + 17 20 const dtsAnnotationComment = [ 18 21 '/** An IntrospectionQuery representation of your schema.', 19 22 ' *', ··· 98 101 99 102 if (/\.d\.ts$/.test(output)) { 100 103 contents = [ 104 + preambleComments, 101 105 dtsAnnotationComment, 102 106 `export type introspection = ${json};\n`, 103 107 "import * as gqlTada from 'gql.tada';\n", ··· 109 113 ].join('\n'); 110 114 } else if (path.extname(output) === '.ts') { 111 115 contents = [ 116 + preambleComments, 112 117 tsAnnotationComment, 113 118 `const introspection = ${json} as const;\n`, 114 119 'export { introspection };',