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

[Feature]: Enforce consistent typing conventions for Storybook's meta #33130

Open
1 task done
dmytrokirpa opened this issue Oct 24, 2024 · 0 comments
Open
1 task done

Comments

@dmytrokirpa
Copy link
Contributor

dmytrokirpa commented Oct 24, 2024

Area

Tooling

Describe the feature that you would like added

Implement the enforcement of consistent typing conventions for Storybook's metadata within the workspace's eslint-rules. Once completed, this can be quickly integrated into the future eslint-plugin-react-components for use across Fluent core and extension repositories.

Example:

import type { Meta } from '@storybook/react'; 

// Valid
const const meta = {
  title: 'Some Title',
  component: SomeComponent
} satisfies Meta<typeof SomeComponent>;

// Valid
export default {
  title: 'Some Title',
  component: SomeComponent
} satisfies Meta<typeof SomeComponent>;


// Invalid
const meta: Meta<typeof SomeComponent> =  {
  title: 'Some Title',
  component: SomeComponent
};

// Invalid
const meta =  {
  title: 'Some Title',
  component: SomeComponent
} as Meta<typeof SomeComponent>;

// Invalid
export default {
  title: 'Some Title',
  component: SomeComponent
} as Meta<typeof SomeComponent>;

Originally discussed here microsoft/fluentui-contrib#252 (comment)

Additional context

No response

Have you discussed this feature with our team

@microsoft/cxe-prg

Validations

  • Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.

Priority

None

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

No branches or pull requests

3 participants