fluentui
fluentui copied to clipboard
[Feature]: Enforce consistent typing conventions for Storybook's meta
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 https://github.com/microsoft/fluentui-contrib/pull/252#discussion_r1812712262
Additional context
No response
Have you discussed this feature with our team
@microsoft/cxe-prg
Validations
- [x] Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.
Priority
None
This issue has not had activity for over 180 days! We're adding Soft close label and will close it soon for house-keeping purposes. Still require assistance? Please add comment - "keep open".
keep open