eslint-plugin-lodash
eslint-plugin-lodash copied to clipboard
path-style rule auto-fix incorrectly formats object accessor causing regressions!
I see another bug related to the default setting for this rule, but it also doesnt correctly autofix. Take this code:
const { data } = params;
// data is { inventory { 1: 5}}
const inventoryForMonth = get(data, ['inventory', monthNum], 0);
the autofix changed it to:
const inventoryForMonth = get(data, `inventory${monthNum}`, 0);
the correct fix would have been
const inventoryForMonth = get(data, `inventory.${monthNum}`, 0);
or
const inventoryForMonth = get(data, `inventory[${monthNum}]`, 0);
@chalda could you post a repo URL on your end to reproduce this easily?