storybookjs / eslint-plugin-storybook

🎗Official ESLint plugin for Storybook
MIT License
245 stars 52 forks source link

Fix prefer-pascal-case to support typescript & variable references #26

Closed shilman closed 2 years ago

shilman commented 2 years ago

Issue: N/A

What Changed

Support

        export const primary = {}
        primary.foo = 'bar'
        export const primary: Story = {}

Checklist

Check the ones applicable to your change:

Change Type

Indicate the type of change your pull request is:

yannbf commented 2 years ago

Awesome stuff ❤️

I found a bug in an example using Typescript:

export const withModalOpen: Story = Template.bind({})
withModalOpen.parameters = {
  msw: [rest.get(REQUEST_URL, (req, res, ctx) => res(ctx.json(restaurants[0])))],
}

Resulted in:

export const WithModalOpen: Story = Template.bind({})
WithModalOpen: Story.parameters = { // 👈   broken!
  msw: [rest.get(REQUEST_URL, (req, res, ctx) => res(ctx.json(restaurants[0])))],
}
yannbf commented 2 years ago

Thank you @shilman !!

github-actions[bot] commented 2 years ago

:rocket: PR was released in v0.3.0 :rocket: