question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make Sort Keys Fixable, the Return

See original GitHub issue

Hey Everyone,

There was a much-needed discussion around how auto fixing sort-keys will change how the code functions at runtime (7714).

This is not ideal, but I feel this is the case that // eslint-disable is justified. If teams are deciding to warn (or prevent) developers from having unsorted keys, why wouldn’t we give them the ability to simply fix it?

I’m happy to tackle this problem if I get a strong signal to make this rule auto-fixable

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
TheSaviorcommented, Aug 1, 2018

Should sort-keys only care about either side of the spread?

1reaction
ljharbcommented, Aug 2, 2018

ahh yes, you’re right - it’s insertion order for non-numeric keys.

I still don’t think this is a real concern; anyone relying on key ordering will break in older browsers too 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript object fixed sort by key - Stack Overflow
You cannot guarentee object key order. If you need to force an order, then either use an array, or keep a secondary array...
Read more >
eslint-plugin-sort-keys-fix - npm
Fork of eslint rule that sorts keys in objects (https://eslint.org/docs/rules/sort-keys) with autofix enabled. Latest version: 1.1.2, ...
Read more >
List Rendering - Vue.js
The iteration order will be based on the result of calling Object.keys() on ... can create a computed property that returns the filtered...
Read more >
Choosing the Right DynamoDB Partition Key - AWS
All data under a partition key is sorted by the sort key value. ... In this case, use an additional prefix or suffix...
Read more >
Dictionaries in Python - Real Python
Python is interpreting them as dictionary keys. If you define this same dictionary in reverse order, you still get the same values using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found