Skip to content

Commit 9846500

Browse files
committed
quick cleanup
1 parent 2996b70 commit 9846500

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/rules/use-client.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ const create = Components.detect(
115115
}
116116

117117
function getIsSafeWindowCheck(node: Rule.NodeParentExtension) {
118-
119118
// check if the window usage is behind a typeof window === 'undefined' check
120119
const conditionalExpressionNode = node.parent?.parent;
121120
const isWindowCheck =
@@ -142,8 +141,7 @@ const create = Components.detect(
142141
(isNegatedWindowCheck &&
143142
conditionalExpressionNode.consequent === node?.parent);
144143

145-
return isSafelyBehindWindowCheck
146-
144+
return isSafelyBehindWindowCheck;
147145
}
148146

149147
const reactImports: Record<string | "namespace", string | string[]> = {
@@ -243,9 +241,8 @@ const create = Components.detect(
243241
const scopeType = context.getScope().type;
244242

245243
const isSafelyBehindWindowCheck = getIsSafeWindowCheck(node);
246-
247244

248-
if (
245+
if (
249246
undeclaredReferences.has(name) &&
250247
browserOnlyGlobals.has(name) &&
251248
(scopeType === "module" || !!util.getParentComponent(node)) &&

0 commit comments

Comments
 (0)