MetaMask / MetaMask/metamask-design-system
Update component-documentation rule for Storybook event handlers
- Dominant language
- TypeScript
- Stars
- 37
- Forks
- 14
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 60
Description
### **Description**
Documented Storybook stories should default event handlers to the `action` defined in `argTypes` rather than inline `() => undefined` handlers so the interactions log in the Docs sidebar and reviewers can see when handlers fire.
### **Technical Details**
- The `component-documentation` lint rule should detect stories that provide explicit handler defaults inside `args` and prefer the `argTypes` `action` entry instead.
- The typical pattern should be: `actionButtonOnClick` and `onClose` are defined once in `argTypes` with an `action`, and no default `args` value is supplied.
- The rule docs (and Storybook guidelines) should call out this expectation so future stories follow it consistently.
### **Acceptance Criteria**
- Stories that rely on handler args use the `action` from `argTypes` and no inline no-op defaults.
- The rule provides guidance/complaints when handler props still have inline defaults but no action in `argTypes`.
- The documentation mentions why relying on the common action is important for Docs/Interactions visibility.
Contributor guide
Research direction
Start by locating the component-documentation lint rule and its rule documentation or Storybook guidelines, since the payload names no files or tests. Trace how handler defaults in story args and actions in argTypes are assessed, then verify that the rule guidance covers Docs sidebar and interaction visibility.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- storybook, typescript
- Domain
- documentation, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100