eslint-config-canonical icon indicating copy to clipboard operation
eslint-config-canonical copied to clipboard

`sort-keys` autofix is case-sensitive

Open NimmLor opened this issue 3 years ago • 4 comments

In a Json document, the autofix for sort-keys is case-sensitive, resulting in an error for `jsonc/sort-keys`` which is case-insensitive

Expected object keys to be in natural insensitive ascending order. 'usernamePasswordIsEnabled' should be before 'userPoolRegion'. eslint (jsonc/sort-keys)

code produced after autofix:

{
  "userPoolId": "eu-central-1_xxxx",
  "userPoolRegion": "eu-central-1",
  "usernamePasswordIsEnabled": true
}

NimmLor avatar Jan 04 '22 11:01 NimmLor

Could you submit a patch to config?

gajus avatar Jan 04 '22 20:01 gajus

Sure, will do that tommorow 👍🏻

NimmLor avatar Jan 04 '22 20:01 NimmLor

Ok, after some time digging I couldn't find the issue. Changing jsonc/sort-keys had no effect on the autofix. Setting caseSensitive: true removes the error, but it is sorted sensitive.

NimmLor avatar Jan 05 '22 10:01 NimmLor

So is this a bug in jsonc plugin? CC @ota-meshi

gajus avatar Jan 05 '22 15:01 gajus

Closing as there is lack of context.

gajus avatar Jan 16 '23 18:01 gajus