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

state-names forgets to also rename the event targets

Open binary64 opened this issue 2 years ago • 1 comments

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)'

binary64 avatar Jul 10 '22 17:07 binary64

Thank you for your report. This should be fixable easily.

rlaffers avatar Jul 10 '22 18:07 rlaffers

:tada: This issue has been resolved in version 1.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

rlaffers avatar Aug 26 '22 11:08 rlaffers