eslint-plugin-xstate icon indicating copy to clipboard operation
eslint-plugin-xstate copied to clipboard

Statechart property ordering rule?

Open tivac opened this issue 1 year ago • 2 comments

no-invalid-state-props and no-invalid-transition-props do a good job of ensuring only valid keys are used, but it'd be cool to have a new stylistic rule that could enforce a user-configurable order for keys in a machine/state/transition/etc.

tivac avatar Aug 07 '23 18:08 tivac

That is actually a good idea. This may be a bit involved however, as the autofix for this would need to overwrite large chunks of code. It is not a simple case of find and replace. I will look into how feasible this is.

rlaffers avatar Aug 10 '23 07:08 rlaffers

if you're worried about the safety/correctness of the fixes it's always possible to have them be suggestions instead for a while. I wish ESLint fixers could choose to operate just on the AST so swapping Property nodes around like this would be easy & safe.

tivac avatar Aug 17 '23 21:08 tivac