villesau / optional-chaining-codemod

Codemod to migrate from Lodash get and logical and expressions to optional chaining
MIT License
112 stars 14 forks source link

bug on edge case #4

Closed sibelius closed 4 years ago

sibelius commented 4 years ago

input

const padding = (info.padding && info.padding[info.level]) || '';

output

const padding = info.padding?.info.level || '';

it should be:

const padding = info.padding?[info.level] || '';
villesau commented 4 years ago

thanks for reporting! This is fixed in 0.2.0 version. It does not take ( and ) away but I believe Prettier does that for you.