From 56aa004d426beb17475fac0c9c0604a4f4f4207f Mon Sep 17 00:00:00 2001 From: Matheus Cardoso Date: Thu, 19 Dec 2024 13:14:42 -0300 Subject: [PATCH] fix: adjust after inline suggestions --- packages/@lwc/ssr-compiler/src/compile-js/errors.ts | 1 - packages/@lwc/ssr-compiler/src/compile-js/index.ts | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/@lwc/ssr-compiler/src/compile-js/errors.ts b/packages/@lwc/ssr-compiler/src/compile-js/errors.ts index 62ab5c0f70..1a57ad5e4b 100644 --- a/packages/@lwc/ssr-compiler/src/compile-js/errors.ts +++ b/packages/@lwc/ssr-compiler/src/compile-js/errors.ts @@ -16,7 +16,6 @@ type ExtractArguments< ? ExtractArguments // new `N`, add an argument : ExtractArguments // `N` already accounted for : Args; // No `N` found, nothing more to check -``` export function generateError( error: T, diff --git a/packages/@lwc/ssr-compiler/src/compile-js/index.ts b/packages/@lwc/ssr-compiler/src/compile-js/index.ts index e47b3763ca..c0fe02058a 100644 --- a/packages/@lwc/ssr-compiler/src/compile-js/index.ts +++ b/packages/@lwc/ssr-compiler/src/compile-js/index.ts @@ -98,7 +98,7 @@ const visitors: Visitors = { } const { decorators } = node; - validateDecorators(decorators); + validateUniqueDecorator(decorators); const decoratedExpression = decorators?.[0]?.expression; if (is.identifier(decoratedExpression) && decoratedExpression.name === 'api') { state.publicFields.push(node.key.name); @@ -138,7 +138,7 @@ const visitors: Visitors = { } const { decorators } = node; - validateDecorators(decorators); + validateUniqueDecorator(decorators); // The real type is a subset of `Expression`, which doesn't work with the `is` validators const decoratedExpression = decorators?.[0]?.expression; if ( @@ -230,7 +230,7 @@ function validateUniqueDecorator(decorators: EsDecorator[]) { throw generateError(DecoratorErrors.CONFLICT_WITH_ANOTHER_DECORATOR, 'api'); } - const hasTrack = expressions.some((expr) => is.identifier(expr, { name: 'track' }); + const hasTrack = expressions.some((expr) => is.identifier(expr, { name: 'track' })); if ((hasWire || hasApi) && hasTrack) { throw generateError(DecoratorErrors.CONFLICT_WITH_ANOTHER_DECORATOR, 'track');