Skip to content

feat(eslint-plugin): wire base-hook-signature and base-hook-no-forbidden-runtime#36254

Merged
Hotell merged 1 commit into
microsoft:masterfrom
Hotell:tools/ws-lint/wire-base-hook-rules
Jun 16, 2026
Merged

feat(eslint-plugin): wire base-hook-signature and base-hook-no-forbidden-runtime#36254
Hotell merged 1 commit into
microsoft:masterfrom
Hotell:tools/ws-lint/wire-base-hook-rules

Conversation

@Hotell

@Hotell Hotell commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Wires the two new workspace rules into the internal @fluentui/eslint-plugin config:

  • '@nx/workspace-base-hook-signature': 'error'
  • '@nx/workspace-base-hook-no-forbidden-runtime': 'error'

After this lands, every project that consumes @fluentui/eslint-plugin's internal preset (i.e. all react-components packages via eslint.config.js → root eslint.config.js) enforces both rules on useFooBase hook files.

Plan reference

Part of the split of #36251 — see prd/eslint-rules-base-hook-pr-split.spec.md (PR3).

Merge order — IMPORTANT

This PR must merge last, after:

  1. tools/ws-lint/rule-base-hook-signature (registers base-hook-signature)
  2. tools/ws-lint/rule-base-hook-no-forbidden-runtime (registers base-hook-no-forbidden-runtime)

Without those, nx run-many -t lint will fail with Could not find "workspace-base-hook-*" in plugin "@nx".

Additional gate

Lint cannot pass cleanly until the separate useTagGroup.ts suppression PR lands — the new base-hook-signature rule already detected a real violation in packages/react-components/react-tags/library/src/components/TagGroup/useTagGroup.ts (3 positional params instead of ≤ 2). That fix/suppression is being landed separately.

Verification

After PR1 + PR2 are on master and this branch is rebased:

nx run eslint-rules:test
nx run-many -t lint

ESLint CLI perf (combined cost of both rules, TIMING=200)

Project Combined ms Combined %
react-button 2.30 ms 0.1%
react-combobox 3.21 ms 0.1%
react-tags 3.07 ms 0.1%

Negligible — total lint runtime per package is dominated by @typescript-eslint/no-deprecated (≈1000 ms) and react-hooks/static-components (≈400 ms).

Out of scope

  • useTagGroup.ts fix/suppression (separate PR).
  • Beachball change file (declined — tooling-only change).

@github-actions

github-actions Bot commented May 26, 2026

Copy link
Copy Markdown

📊 Bundle size report

✅ No changes found

@github-actions

Copy link
Copy Markdown

Pull request demo site: URL

Comment thread packages/eslint-plugin/src/internal.js
…den-runtime

Enables @nx/workspace-base-hook-signature and @nx/workspace-base-hook-no-forbidden-runtime in the internal @fluentui/eslint-plugin config. Depends on:- PR adding the base-hook-signature rule- PR adding the base-hook-no-forbidden-runtime ruleMust merge AFTER both rule-introducing PRs land on master. Lint gate also requires the separate useTagGroup.ts suppression PR.
@Hotell Hotell force-pushed the tools/ws-lint/wire-base-hook-rules branch from 5436fc9 to b6a25e5 Compare June 16, 2026 10:34
@Hotell Hotell marked this pull request as ready for review June 16, 2026 11:26
@Hotell Hotell requested a review from a team as a code owner June 16, 2026 11:26
@Hotell Hotell merged commit a904429 into microsoft:master Jun 16, 2026
13 checks passed
@Hotell Hotell deleted the tools/ws-lint/wire-base-hook-rules branch June 16, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants