Skip to content

Commit

Permalink
avoid altering the file when there are ts errors (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock authored Oct 28, 2023
1 parent 71fcdc9 commit 3558964
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/popular-clocks-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@0no-co/graphqlsp': patch
---

Correctly bail when file has typescript errors
6 changes: 2 additions & 4 deletions packages/graphqlsp/src/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,10 @@ export function getGraphQLDiagnostics(
scalars,
baseTypesPath
).then(({ success }) => {
if (!success) return undefined;
if (!success || hasTSErrors) return;

source = getSource(info, filename);
if (!source) return undefined;

if (isFileDirty(filename, source) && !hasTSErrors) {
if (!source || isFileDirty(filename, source)) {
return;
}

Expand Down

0 comments on commit 3558964

Please sign in to comment.