Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/eslint-plugin/src/internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const __internal = {
/** @type {import('eslint').Linter.RulesRecord} */
Copy link
Copy Markdown

@github-actions github-actions Bot May 21, 2026

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/Charts-DonutChart 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Charts-DonutChart.Dynamic.default.chromium.png 5581 Changed
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default.submenus open.chromium.png 413 Changed
vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default - RTL.submenus open.chromium.png 599 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 505 Changed
vr-tests-react-components/Positioning.Positioning end.chromium.png 839 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 89 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png 95 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png 41 Changed
vr-tests-react-components/Skeleton converged 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Skeleton converged.Opaque Skeleton with rectangle - Dark Mode.default.chromium.png 9 Changed
vr-tests-react-components/TagPicker 3 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/TagPicker.disabled - Dark Mode.disabled input hover.chromium.png 658 Changed
vr-tests-react-components/TagPicker.disabled - High Contrast.disabled input hover.chromium.png 1319 Changed
vr-tests-react-components/TagPicker.disabled.chromium.png 677 Changed
vr-tests-web-components/Badge 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-web-components/Badge. - Dark Mode.normal.chromium.png 443 Changed
vr-tests-web-components/MenuList 3 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-web-components/MenuList. - RTL.1st selected.chromium_2.png 39384 Changed
vr-tests-web-components/MenuList. - RTL.normal.chromium_1.png 39083 Changed
vr-tests-web-components/MenuList. - RTL.2nd selected.chromium_3.png 38816 Changed
vr-tests-web-components/RadioGroup 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-web-components/RadioGroup. - Dark Mode.normal.chromium_1.png 89 Changed
vr-tests/Callout 8 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/Callout.Right center.default.chromium.png 2117 Changed
vr-tests/Callout.Gap space 25.default.chromium.png 2195 Changed
vr-tests/Callout.Left bottom edge.default.chromium.png 3182 Changed
vr-tests/Callout.Right top edge.default.chromium.png 1126 Changed
vr-tests/Callout.No beak.default.chromium.png 2192 Changed
vr-tests/Callout.Root.default.chromium.png 2195 Changed
vr-tests/Callout.Top center.default.chromium.png 2127 Changed
vr-tests/Callout.Top auto edge.default.chromium.png 2212 Changed
vr-tests/Keytip 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/Keytip.Disabled.default.chromium.png 26 Changed
vr-tests/Keytip.Root.default.chromium.png 51 Changed
vr-tests/Pivot - Overflow 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/Pivot - Overflow.Tabs - RTL.chromium.png 4471 Changed
vr-tests/react-charting-GaugeChart 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/react-charting-GaugeChart.Basic.default.chromium.png 2 Changed
vr-tests/react-charting-LineChart 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/react-charting-LineChart.Multiple - Dark Mode.default.chromium.png 181 Changed
vr-tests/react-charting-LineChart.Multiple - RTL.default.chromium.png 200 Changed
vr-tests/react-charting-VerticalBarChart 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/react-charting-VerticalBarChart.Basic - Secondary Y Axis.default.chromium.png 3 Changed

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

rules: {
'@nx/workspace-consistent-callback-type': 'error',
'@nx/workspace-consistent-base-hook': 'error',
'@nx/workspace-no-restricted-globals': restrictedGlobals.react,
'@nx/workspace-no-missing-jsx-pragma': ['error', { runtime: 'automatic' }],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type UseTagGroupBaseOptions = {
* @param props - props from this instance of TagGroup (without appearance, size)
* @param ref - reference to root HTMLDivElement of TagGroup
*/
// eslint-disable-next-line @nx/workspace-consistent-base-hook -- accepts an extra `options` arg used internally by `useTagGroup_unstable` to coordinate focus after a tag is dismissed
export const useTagGroupBase_unstable = (
props: TagGroupBaseProps,
ref: React.Ref<HTMLDivElement>,
Expand Down
2 changes: 2 additions & 0 deletions tools/eslint-rules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
RULE_NAME as consistentCallbackTypeName,
rule as consistentCallbackType,
} from './rules/consistent-callback-type';
import { RULE_NAME as consistentBaseHookName, rule as consistentBaseHook } from './rules/consistent-base-hook';

/**
* Import your custom workspace rules at the top of this file.
Expand Down Expand Up @@ -32,6 +33,7 @@ module.exports = {
*/
rules: {
[consistentCallbackTypeName]: consistentCallbackType,
[consistentBaseHookName]: consistentBaseHook,
[noRestrictedGlobalsName]: noRestrictedGlobals,
[noMissingJsxPragmaName]: noMissingJsxPragma,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as React from 'react';

// Sibling base hook used to verify cross-file pair detection in the rule's spec.
// The wrapping state hook lives in `useSibling.ts` next to this file.
export const useSiblingBase_unstable = (props: { a: number }, ref: React.Ref<HTMLElement>) => {
return { props, ref };
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Placeholder so the tsconfig has an actual file to anchor the project.
// RuleTester test cases reference filenames inside this directory but their
// content comes from the inline `code` field.
export const dummy = 1;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Placeholder anchor for typed RuleTester cases. The actual code being linted
// comes from each test's inline `code` field; this file just needs to exist so
// that the fixture tsconfig's Program contains the filename used by tests.
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { useB } from './b';

export function useA(): number {
return useB() + 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { useA } from './a';

export function useB(): number {
// Pretend lazy ref to break true cycle at runtime; the static graph is cyclic.
return (useA as unknown as () => number).length;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Cyclic re-export — exercises the cycle-safety of the transitive walk.
export { useA } from './a';
export { useB } from './b';
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export function runHeavy(): { tag: 'heavy' } {
return { tag: 'heavy' };
}

export type HeavyOptions = { kind: 'heavy' };
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function runLight(_opts?: { mode: 'light' }): void {
/* noop */
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { runHeavy } from 'heavy-runtime';

export type HeavyType = { tag: 'heavy' };

export function useHeavy(): HeavyType {
return runHeavy();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { HeavyType } from './heavy';

export { useHeavy } from './heavy';
export { useLight } from './light';
export type { LightOptions } from './light';
// Re-export of a type-only thing from the heavy module — must not count as a runtime reach.
export type { HeavyType } from './heavy';

export type HeavyWrapper = { tag: 'heavy-wrapper'; inner: HeavyType };
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { runLight } from 'light-helper';

export type LightOptions = { mode: 'light' };

export function useLight(opts?: LightOptions): void {
runLight(opts);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "node",
"lib": ["ES2022", "DOM"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"noEmit": true,
"baseUrl": ".",
"paths": {
"watched-pkg": ["./stubs/watched-pkg/index.ts"],
"watched-pkg/*": ["./stubs/watched-pkg/*"],
"heavy-runtime": ["./stubs/heavy-runtime/index.ts"],
"light-helper": ["./stubs/light-helper/index.ts"],
"cyclic-pkg": ["./stubs/cyclic-pkg/index.ts"]
}
},
"include": ["src/**/*.ts", "src/**/*.tsx", "stubs/**/*.ts"]
}
Loading
Loading