Open Pyrolistical opened 8 months ago
sort-enums
Zod is a very popular TypeScript schema validation library.
Zod allows you to define an enums using an array of strings z.enum. This array of strings should be sorted by sort-enums
z.enum
import {z} from 'zod'; const SomeEnum = z.enum(["B", "C", "A"]); // this array can be sorted type SomeEnum = z.infer<typeof SomeEnum>; // 'B' | 'C' | 'A'
No response
What rule do you want to change?
sort-enums
Describe the problem
Zod is a very popular TypeScript schema validation library.
Zod allows you to define an enums using an array of strings
z.enum
. This array of strings should be sorted bysort-enums
Code example
Additional comments
No response
Validations