News for hackers. Stuff that matters.
Re:Ask HN: What was the biggest leadership challenge of your... by goodpoint on Sunday April 18, 2021 @12:17PM (#26853743)
> having this as a rule that keys in dictionaries are sorted alphabetically can be a valid rule

Ordering keys to prevent randomness is very helpful to spot changes when using "git diff", doing code reviews, comparing files side by side.

Often it helped me spotting bugs due to a missing or unwanted element.

I wish code linters had enabled by default with the ability to disable it with some simple syntax.

Re:Ask HN: What was the biggest leadership challenge of your... by johnchristopher on Sunday April 18, 2021 @01:37PM (#26854553)
I had a look at prettier's github issues in the mean time and

> No, prettier tries not to change the semantics (specifically, the AST) of the program, and sorting imports/keys could break that guarantee. See here for more details and context, as well as links to similar/duplicate issues: #1684 (comment)

it makes sense not to make it a default.

https://github.com/prettier/prettier/issues/2460 https://github.com/prettier/prettier/issues/1684#issuecommen...