(fixer)
| 75 | node, |
| 76 | message: 'Prefer optional chaining.', |
| 77 | fix(fixer) { |
| 78 | // Find the last valid member expression sequence |
| 79 | let last = first; |
| 80 | while (last < ops.length - 1 && isValidMemberExpressionPair(ops[last], ops[last + 1])) { |
| 81 | last++; |
| 82 | } |
| 83 | |
| 84 | return fixer.replaceTextRange( |
| 85 | [ops[first].range[0], ops[last].range[1]], |
| 86 | generateOptionalChaining(ops, first, last), |
| 87 | ); |
| 88 | }, |
| 89 | }); |
| 90 | }, |
| 91 | }; |
nothing calls this directly
no test coverage detected