Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the @ts-ignore directive on TS import in type declaration output #27

Merged
merged 3 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/serious-hotels-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@0no-co/graphql.web": patch
---

Fix `@ts-ignore` on TypeScript peer dependency import in typings not being applied due to a leading `!` character.
2 changes: 1 addition & 1 deletion scripts/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export default [
renderChunk(code, chunk) {
if (chunk.fileName.endsWith('d.ts')) {
const gqlImportRe = /(import\s+(?:[*\s{}\w\d]+)\s*from\s*'graphql';?)/g;
code = code.replace(gqlImportRe, x => '/*!@ts-ignore*/\n' + x);
code = code.replace(gqlImportRe, x => '/*@ts-ignore*/\n' + x);

code = prettier.format(code, {
filepath: chunk.fileName,
Expand Down