eslint-plugin-lodash icon indicating copy to clipboard operation
eslint-plugin-lodash copied to clipboard

path-style rule auto-fix incorrectly formats object accessor causing regressions!

Open chalda opened this issue 4 years ago • 1 comments

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 avatar Apr 27 '21 19:04 chalda

@chalda could you post a repo URL on your end to reproduce this easily?

Inlesco avatar Aug 05 '21 14:08 Inlesco