microsoft / microsoft/fluentui

[Feature]: create `eslint` rule to enforce style hook API consistency

Open
#30,385 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area: Build System Area: Linting Fluent UI react-components (v9) NX: workspace eslint-rules Resolution: Soft Close Type: Feature
Dominant language
TypeScript
Stars
20.3k
Forks
2.9k
Avg merge
2d 9h
Merged PRs (30d)
46

Description

Library

React Components / v9 (@fluentui/react-components)

Describe the feature that you would like added

Add a new lint rule to enforce the style hook API contract of:

useComponentStyle(state: ComponentState) => ComponentState

That is, that all style hooks take in ComponentState and also return ComponentState.

Have you discussed this feature with our team

@hotell

Additional context

This is a follow up to #30349

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

Normal

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the context in issue #30349 and the repository's existing ESLint rules for React Components. Confirm the rule's expected handling of style hooks, then add coverage showing that hooks accept and return ComponentState; done means inconsistent signatures are reported while valid ones pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, react, typescript
Domain
frontend, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.