Search Terms
Suggestion
sort string literal in .d.ts
Use Cases
avoid string literal random change order when source code didn't change
and make code history is more easy read
in this issue thread string literal is mean => "a" | "c" | "b"
this not only happen on Record, it has chance happen at all type is auto create by typescript emit with string literal
Examples
"a" | "c" | "b" is create by typesctipt emit and some time will random change order
current .d.ts output
export declare const table_plus: Record<"a" | "c" | "b">
// "a" | "c" | "b" is random change order
in this request
sort ( use simple array.sort() ) it when output emit at .d.ts
export declare const table_plus: Record<"a" | "b" | "c">
Checklist
My suggestion meets these guidelines:
Maintainer's note [@sandersn]: To implementers: When you implement this, be sure to sort other literal types too. Consider sorting other things, like symbol, by the order of their string representation.
Search Terms
Suggestion
sort string literal in .d.ts
Use Cases
avoid string literal random change order when source code didn't change
and make code history is more easy read
in this issue thread
string literalis mean =>"a" | "c" | "b"this not only happen on
Record, it has chance happen at all type is auto create by typescript emit withstring literalExamples
current .d.ts output
in this request
Checklist
My suggestion meets these guidelines:
Maintainer's note [@sandersn]: To implementers: When you implement this, be sure to sort other literal types too. Consider sorting other things, like symbol, by the order of their string representation.