Skip to content

Commit 0a4fef7

Browse files
IvanUkhovkitten
andauthored
Fix the @ts-ignore directive on TS import in type declaration output (#27)
* Fix the directive syntax for ignoring errors due to unavailable peer dependencies * Add a changeset * Update .changeset/serious-hotels-shake.md --------- Co-authored-by: Phil Pluckthun <[email protected]>
1 parent 14b1a0c commit 0a4fef7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/serious-hotels-shake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@0no-co/graphql.web": patch
3+
---
4+
5+
Fix `@ts-ignore` on TypeScript peer dependency import in typings not being applied due to a leading `!` character.

scripts/rollup.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export default [
233233
renderChunk(code, chunk) {
234234
if (chunk.fileName.endsWith('d.ts')) {
235235
const gqlImportRe = /(import\s+(?:[*\s{}\w\d]+)\s*from\s*'graphql';?)/g;
236-
code = code.replace(gqlImportRe, x => '/*!@ts-ignore*/\n' + x);
236+
code = code.replace(gqlImportRe, x => '/*@ts-ignore*/\n' + x);
237237

238238
code = prettier.format(code, {
239239
filepath: chunk.fileName,

0 commit comments

Comments
 (0)