From bf527cd6e761b72e81a5dfcb310353c11056c6e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Tue, 21 Mar 2023 11:58:58 +0900 Subject: [PATCH] refactor(#10336): semantics --- packages/frontend/.storybook/generate.tsx | 8 +++++++- packages/frontend/.storybook/preview.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/frontend/.storybook/generate.tsx b/packages/frontend/.storybook/generate.tsx index 327ed4bc7951..0a4ec39108c0 100644 --- a/packages/frontend/.storybook/generate.tsx +++ b/packages/frontend/.storybook/generate.tsx @@ -16,7 +16,13 @@ interface SatisfiesExpression extends estree.BaseExpression { const generator = { ...GENERATOR, SatisfiesExpression(node: SatisfiesExpression, state: State) { - this[node.expression.type](node.expression, state); + if (node.expression.type === 'ArrowFunctionExpression') { + state.write('('); + this[node.expression.type](node.expression, state); + state.write(')'); + } else { + this[node.expression.type](node.expression, state); + } state.write(' satisfies '); this[node.reference.type](node.reference, state); }, diff --git a/packages/frontend/.storybook/preview.ts b/packages/frontend/.storybook/preview.ts index a39b59fa7bf5..72e642189f18 100644 --- a/packages/frontend/.storybook/preview.ts +++ b/packages/frontend/.storybook/preview.ts @@ -64,7 +64,7 @@ const preview = { const story = Story(); if (!initialized) { const channel = addons.getChannel(); - requestIdleCallback(() => { + (globalThis.requestIdleCallback || setTimeout)(() => { channel.emit(FORCE_REMOUNT, { storyId: context.id }); }); }