Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importing story meta from another module and re-exporting it is not working #158

Open
pkyeck opened this issue Jun 12, 2024 · 0 comments
Open

Comments

@pkyeck
Copy link

pkyeck commented Jun 12, 2024

Describe the bug
I split up my stories for a certain component b/c the file was just getting bigger and bigger but I wanted to have a central file with the meta information like so:

// ComponentA.meta.ts

export const meta: Meta<Props> = {
  title: 'Templates/Common/ComponentA',
  render: (args) => ComponentA(args),
  tags: ['tag1'],
  // ...
}

// ComponentAExtra1.stories.ts

export { meta as default } from './ComponentA.meta'
export const ComponentAExtra1Story: StoryObj<Props> = {
  // ...
}

// ComponentAExtra2.stories.ts

export { meta as default } from './ComponentA.meta'
export const ComponentAExtra2Story: StoryObj<Props> = {
  // ...
}

but the plugin is complaining that

The file should have a default export. eslint(storybook/default-exports)

Should this be working? I also tried to import first and then export default meta then the plugin is not complaining but storybook will tell me: CSF: missing default export

Is it possible to share the meta object and how?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant