squelch static-state-reference warning

log-rune
Rich Harris 10 months ago
parent 3b1e81289a
commit 8964d1a0ab

@ -659,6 +659,14 @@ const runes_scope_js_tweaker = {
/** @type {import('./types').Visitors} */
const runes_scope_tweaker = {
CallExpression(node, { state, next }) {
const rune = get_rune(node, state.scope);
// `$log(foo)` should not trigger the `static-state-reference` warning
if (rune?.startsWith('$log')) {
next({ ...state, function_depth: state.function_depth + 1 });
}
},
VariableDeclarator(node, { state }) {
if (node.init?.type !== 'CallExpression') return;
if (get_rune(node.init, state.scope) === null) return;

Loading…
Cancel
Save