const createFixer = ({range, left, right, operator}, source) => fixer => {
  const [leftStart, leftEnd] = left.range;
  const [rightStart] = right.range;
  const operatorRange = [leftEnd, rightStart];
  const operatorText = source.slice(...operatorRange);

  if (operator === '||') {
    const leftText = source.slice(leftStart, leftEnd);
    return [
      fixer.replaceTextRange(operatorRange, operatorText.replace(operator, `? ${leftText} :`))
    ];
  }

  return [
    fixer.replaceTextRange(operatorRange, operatorText.replace(operator, '?')),
    fixer.insertTextAfterRange(range, ' : null')
  ];
};

const create = context => ({
  LogicalExpression: node => {
    if (node.right.type === 'JSXElement') {
      context.report({
        node,
        message: 'JSX should not use logical expression',
        fix: createFixer(node, context.getSourceCode().getText())
      });
    }
  }
});

module.exports = {
  create,
  createFixer,
  meta: {
    docs: {
      description: 'Prevent falsy values to be printed'
    },
    fixable: 'code'
  }
};

@@ -12,16 +12,18 @@
 eFixer =
+%0A 
  (%7Brange
@@ -58,16 +58,18 @@
 urce) =%3E
+%0A 
  fixer =
@@ -74,16 +74,18 @@
  =%3E %7B%0A  
+ 
+ 
 const %5Bl
@@ -109,32 +109,34 @@
 %5D = left.range;%0A
+  
   const %5BrightSt
@@ -153,24 +153,26 @@
 ht.range;%0A  
+ 
+ 
 const operat
@@ -204,16 +204,18 @@
 Start%5D;%0A
+  
   const 
@@ -264,16 +264,18 @@
 ge);%0A%0A  
+ 
+ 
 if (oper
@@ -287,24 +287,26 @@
 === '%7C%7C') %7B%0A
+  
     const le
@@ -352,16 +352,18 @@
 d);%0A    
+ 
+ 
 return %5B
@@ -359,24 +359,26 @@
    return %5B%0A
+  
       fixer.
@@ -468,16 +468,22 @@
     
+  
 %5D;%0A  
+ 
+ 
 %7D%0A%0A
+  
   re
@@ -489,24 +489,26 @@
 eturn %5B%0A    
+  
 fixer.replac
@@ -571,24 +571,26 @@
  '?')),%0A    
+  
 fixer.insert
@@ -622,21 +622,25 @@
  null')%0A
+  
   %5D;%0A
+  
 %7D;%0A%0Acons

Reformat code post prettier update :memo: