Skip to content

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

Draft
Hotell wants to merge 1 commit into
microsoft:masterfrom
Hotell:tools/ws-lint/wire-base-hook-rules
Draft

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

Conversation

@Hotell
Copy link
Copy Markdown
Contributor

@Hotell Hotell commented May 26, 2026

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).

…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.
@github-actions
Copy link
Copy Markdown

📊 Bundle size report

✅ No changes found

@github-actions
Copy link
Copy Markdown

Pull request demo site: URL

@@ -35,6 +35,8 @@ const __internal = {
/** @type {import('eslint').Linter.RulesRecord} */
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵🏾‍♀️ visual changes to review in the Visual Change Report

vr-tests-react-components/Menu Converged - submenuIndicator slotted content 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default - RTL.submenus open.chromium.png 404 Changed
vr-tests-react-components/Positioning 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 725 Changed
vr-tests-react-components/Positioning.Positioning end.chromium.png 512 Changed
vr-tests-react-components/ProgressBar converged 3 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - Dark Mode.default.chromium.png 59 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png 148 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png 115 Changed
vr-tests-react-components/TagPicker 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/TagPicker.disabled - High Contrast.disabled input hover.chromium.png 1319 Changed
vr-tests-react-components/TagPicker.disabled - RTL.disabled input hover.chromium.png 635 Changed
vr-tests-web-components/MenuList 4 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-web-components/MenuList. - RTL.2nd selected.chromium.png 17 Changed
vr-tests-web-components/MenuList. - RTL.1st selected.chromium_2.png 39384 Changed
vr-tests-web-components/MenuList. - RTL.2nd selected.chromium_3.png 38816 Changed
vr-tests-web-components/MenuList. - RTL.normal.chromium_1.png 39083 Changed
vr-tests-web-components/TextInput 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-web-components/TextInput. - Dark Mode.normal.chromium_1.png 288 Changed
vr-tests/Coachmark 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/Coachmark.Collapsed.default.chromium.png 159 Changed
vr-tests/react-charting-LineChart 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/react-charting-LineChart.Events - Dark Mode.default.chromium.png 16 Changed
vr-tests/react-charting-LineChart.Events.default.chromium.png 17 Changed
vr-tests/react-charting-MultiStackBarChart 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/react-charting-MultiStackBarChart.Basic_PartToWhole - Dark Mode.default.chromium.png 363 Changed
vr-tests/react-charting-VerticalBarChart 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/react-charting-VerticalBarChart.Basic - Secondary Y Axis.default.chromium.png 3 Changed
vr-tests/react-charting-VerticalBarChart.Grouped - Wrap Labels - Dark Mode.default.chromium.png 2987 Changed

There were 2 duplicate changes discarded. Check the build logs for more information.

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.

1 participant