eslint-plugin-xstate
eslint-plugin-xstate copied to clipboard
state-names forgets to also rename the event targets
My machine:
createMachine({
initial: 'I am off',
states: {
'I am off': {
on: {
EVENT_1: {
target: 'I am on',
},
EVENT_2: {
target: 'I am on',
},
},
},
'I am on': {},
},
id: '(machine)',
})
xstate/state-names highlights the 2 state name above, and autofixes them to iAmOff/iAmOn, but not the target: 'I am on',
part.
Resulting in a bad machine:
Invalid transition definition for state node '(machine).iAmOff':
Child state 'I am on' does not exist on '(machine)'
Thank you for your report. This should be fixable easily.
:tada: This issue has been resolved in version 1.0.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket: