Convert ()=>{} to normal function and remove optional chaining
MODIFY
packages/@romejs/js-compiler/transforms/lint/noCompareNegZero.ts
packages/@romejs/js-compiler/transforms/lint/noCompareNegZero.ts
@@ -18,11 +18,14 @@ const OPERATORS_TO_CHECK = new Set([
'!==',
]);
-const isNegZero = (node: AnyNode) =>
- node?.type === 'UnaryExpression' &&
+function isNegZero(node: AnyNode): boolean {
+ return (
+ node.type === 'UnaryExpression' &&
node.operator === '-' &&
node.argument?.type === 'NumericLiteral' &&
- node.argument.value === 0;
+ node.argument.value === 0
+ );
+}
export default {
name: 'noCompareNegZero',

Convert ()=>{} to normal function and remove optional chaining