Skip to content

Commit 5cd9644

Browse files
committed
fix: disable no-shadow lint rule and remove dead code in query
Disable no-shadow in oxlintrc as all occurrences are intentional. Remove unreachable while loop guarding trigger assignment since the Promise executor runs synchronously, guaranteeing trigger is defined before the loop could ever be reached.
1 parent ec990b9 commit 5cd9644

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

.oxlintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"suspicious": "warn"
77
},
88
"rules": {
9+
"no-shadow": "off",
910
"react-in-jsx-scope": "off"
1011
},
1112
"settings": {

src/query/query.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -407,15 +407,9 @@ export function createQuery(instanceOptions?: Configuration): Query {
407407
resolversCache.set(key, { item: result, controller })
408408
emit(key, 'refetching', result)
409409

410-
trigger = trigger as TriggerFunction
411-
412-
while (trigger === undefined) {
413-
// This ensures that the trigger
414-
// has been defined, as it is defined
415-
// inside the promise.
416-
}
417-
418-
void trigger()
410+
// The promise executor runs synchronously,
411+
// so trigger is guaranteed to be defined here.
412+
void trigger!()
419413

420414
return result
421415
}

0 commit comments

Comments
 (0)