Skip to content

Commit

Permalink
fix: adjust after inline suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
cardoso committed Dec 19, 2024
1 parent 617b3ef commit 56aa004
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion packages/@lwc/ssr-compiler/src/compile-js/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ type ExtractArguments<
? ExtractArguments<R, Numbers, Args> // new `N`, add an argument
: ExtractArguments<R, N | Numbers, [string, ...Args]> // `N` already accounted for
: Args; // No `N` found, nothing more to check
```

export function generateError<const T extends LWCErrorInfo>(
error: T,
Expand Down
6 changes: 3 additions & 3 deletions packages/@lwc/ssr-compiler/src/compile-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 (
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 56aa004

Please sign in to comment.