Skip to content

Commit

Permalink
style: apply automated linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
megalinter-bot committed Oct 17, 2023
1 parent ff06291 commit 9569cdd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/language/validation/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,14 @@ export const elvisOperatorShouldBeNeeded = (services: SafeDsServices) => {
const leftValue = toConstantExpressionOrUndefined(node.leftOperand);
const rightValue = toConstantExpressionOrUndefined(node.rightOperand);
if (leftValue === ConstantNull && rightValue === ConstantNull) {
accept('info', 'Both operands are always null, so the elvis operator is unnecessary (replace it with null).', {
node,
code: CODE_STYLE_UNNECESSARY_ELVIS_OPERATOR,
});
accept(
'info',
'Both operands are always null, so the elvis operator is unnecessary (replace it with null).',
{
node,
code: CODE_STYLE_UNNECESSARY_ELVIS_OPERATOR,
},
);
} else if (leftValue === ConstantNull) {
accept(
'info',
Expand Down

0 comments on commit 9569cdd

Please sign in to comment.