-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from storybookjs/docs/update-rule-docs
Docs/update rule docs
- Loading branch information
Showing
16 changed files
with
155 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
# Component property must be set in meta (csf-component) | ||
|
||
Please describe the origin of the rule here. | ||
<!-- RULE-CATEGORIES:START --> | ||
|
||
**Categories**: csf | ||
|
||
<!-- RULE-CATEGORIES:END --> | ||
|
||
## Rule Details | ||
|
||
This rule aims to... | ||
This rule encourages you to set the `component` property of your CSF default export. The `component` property is optional, but configuring unlocks a variety of features in Storybook, including automatic prop table documentation in most frameworks, auto-generated controls for dynamically editing your stories, and in CSF3, a resonable default for rendering your component without having to define a render function. | ||
|
||
Examples of **incorrect** code for this rule: | ||
|
||
```js | ||
export default { | ||
title: 'Button' | ||
export default { | ||
title: 'Button', | ||
} | ||
``` | ||
|
||
Examples of **correct** code for this rule: | ||
|
||
```js | ||
export default { | ||
title: 'Button', | ||
component: Button | ||
export default { | ||
title: 'Button', | ||
component: Button, | ||
} | ||
``` | ||
|
||
### Options | ||
|
||
If there are any options, describe them here. Otherwise, delete this section. | ||
|
||
## When Not To Use It | ||
|
||
Give a short description of when it would be appropriate to turn off this rule. | ||
While we encourage each CSF file to clearly correspond to a single component, it's possible to organize a Storybook in any way you choose. If you have some other organization scheme, especially if you're migrating from the legacy `storiesOf` API, this rule might not apply to you. | ||
|
||
## Further Reading | ||
|
||
If there are other links that describe the issue this rule addresses, please include them here in a bulleted list. | ||
- [Automatic argType inference](https://storybook.js.org/docs/react/api/argtypes#automatic-argtype-inference) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.