Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chalda opened this issue Apr 27, 2021 · 1 comment

Comments

@chalda
Copy link

chalda commented Apr 27, 2021

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);
@Inlesco
Copy link

Inlesco commented Aug 5, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants