Skip to content

[code-infra] Fix lint issues#22757

Merged
brijeshb42 merged 12 commits into
mui:masterfrom
brijeshb42:bump-pkg-versions
Jun 17, 2026
Merged

[code-infra] Fix lint issues#22757
brijeshb42 merged 12 commits into
mui:masterfrom
brijeshb42:bump-pkg-versions

Conversation

@brijeshb42

Copy link
Copy Markdown
Contributor

@brijeshb42 brijeshb42 added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). labels Jun 11, 2026
@code-infra-dashboard

code-infra-dashboard Bot commented Jun 11, 2026

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-22757--material-ui-x.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 🔺+13B(0.00%) 🔺+25B(+0.02%)
@mui/x-charts-pro 🔺+13B(0.00%) 🔺+32B(+0.02%)
@mui/x-charts-premium 🔺+13B(0.00%) 🔺+57B(+0.03%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view ▼-22B(-0.03%) ▼-3B(-0.02%)
@mui/x-tree-view-pro ▼-22B(-0.02%) ▼-5B(-0.01%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

Total duration: 1,738.15 ms -308.89 ms(-15.1%) | Renders: 63 (▼-4)

Test Duration Renders
RangeBarChart with big data amount 63.53 ms ▼-26.37 ms(-29.3%) 2 (▼-1)
BarChart stacked with multiple series 111.99 ms -22.14 ms(-16.5%) 2 (▼-1)
BarChart with big data amount 78.44 ms -12.57 ms(-13.8%) 2 (▼-1)
BarChartPro with big data amount 40.29 ms +2.26 ms(+5.9%) 2 (▼-1)
SparkLineChart grid of 100 instances 137.47 ms ▼-57.70 ms(-29.6%) 1 (+0)

…and 9 more (+12 within noise) — details


Check out the code infra dashboard for more information about this PR.

@brijeshb42
brijeshb42 requested review from a team and LukasTy June 11, 2026 10:13
Comment thread eslint.config.mjs Outdated
},
rules: {
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/no-shadow': 'off',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

typescript-eslint >=8.60 flags the named function expression in the common const Foo = React.forwardRef(function Foo() {}) idiom as shadowing its own const binding. So disabled it. The implication is that it disables genuine shadowing issues.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we look into this at the code infra level? I guess all repos will hit this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. We can disable it at code-infra level, but it should be temporary. Otherwise, it'll not surface genuine issues.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll move this to code-infra parallelly though since I need this PR to merge my other i18n related PR.

Comment thread eslint.config.mjs Outdated
{
files: [`**/*${EXTENSION_TEST_FILE}`, `test/**/*${EXTENSION_TS}`],
rules: {
'react-hooks/set-state-in-effect': 'off',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

v7.1.1 has this on by default resulting in lint error.

@brijeshb42
brijeshb42 force-pushed the bump-pkg-versions branch 2 times, most recently from be1ba9e to 9d46a61 Compare June 11, 2026 12:43
@brijeshb42
brijeshb42 force-pushed the bump-pkg-versions branch 2 times, most recently from 2837b0b to 5f0b1ed Compare June 12, 2026 04:45
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jun 15, 2026
@brijeshb42

Copy link
Copy Markdown
Contributor Author

@Janpot Need to merge this till we fix it in code-infra as it might block newer PRs. Same on mui/material-ui#48672

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jun 15, 2026
@github-actions github-actions Bot added PR: out-of-date The pull request has merge conflicts and can't be merged. and removed PR: out-of-date The pull request has merge conflicts and can't be merged. labels Jun 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@brijeshb42
brijeshb42 force-pushed the bump-pkg-versions branch 2 times, most recently from ce7422d to 0400e31 Compare June 15, 2026 12:09
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jun 15, 2026

@LukasTy LukasTy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Claude Opus 4.8 Review

Which disables can be dropped

  1. Both useIsHydrated copies (packages/x-charts/src/hooks/useIsHydrated.ts, packages/x-chat-headless/src/chat/internals/useIsHydrated.ts) -- avoidable now, low risk. The rule fires only on passive useEffect. Two options:

    • Lowest friction (no new dep): swap React.useEffect -> useEnhancedEffect. It is already a dep in both packages, is useLayoutEffect on the client / SSR-safe, is not flagged by the rule, and it matches the gaearon gist the file comment already cites ("Option 2: useLayoutEffect"). Bonus: removes the one-frame unhydrated flash.
    • More idiomatic: mirror the existing precedent. packages/x-data-grid/src/hooks/utils/useIsSSR.ts:7 already does exactly this with useSyncExternalStore (via use-sync-external-store/shim, React-17-safe), no effect at all -- useIsHydrated is just its inverse (clientSnapshot = () => true, serverSnapshot = () => false). This needs adding the shim dep to those two packages, so the useEnhancedEffect swap is the lighter touch.
  2. @typescript-eslint/no-shadow: 'off' (eslint.config.mjs, global) -- reconsider. This turns off a real correctness rule across the entire monorepo to unblock a version bump -- the heaviest hammer in the PR. If it is masking a small number of new violations from the parser bump (8.59 -> 8.60), prefer fixing them or scoping the off to the offending files; at minimum add a comment/TODO explaining why.

Leave as-is (legitimate, not worth churning in a bump)

  • useMounted defer branch -- intentional post-paint passive effect; the non-defer branch already uses useEnhancedEffect and is not flagged.
  • The 5 charts-premium setProgram(...) effects -- the effect owns the GL program lifecycle (cleanup calls dispose()); setState there is appropriate.
  • useGridSelector (exhaustive-deps + new use-memo disable) -- hand-optimized hot path passing a module-level EMPTY deps array on purpose; fine.
  • set-state-in-effect: 'off' for test files -- fine. For docs -- acceptable (demos), though docs ideally model best practice.

Out of scope here -- track as a follow-up

The ~15 remaining sites all share one shape: a useEffect that mirrors/adjusts a prop into local state (GridEditBooleanCell, GridEdit{Input,LongText,Date}Cell, the GridFilterInput* family, Month/YearCalendar, GridColumnHeaderItem, the GridActionsCell clamp, Toolbar, ToolbarContext, tree-view itemPlugin). The React-blessed fix is set-state-during-render with a stored previous prop -- the same pattern useGridSelector already uses at packages/x-data-grid/src/hooks/utils/useGridSelector.ts:83, which the linter accepts. Each has behavioral nuance (StrictMode double-invoke, meta guards), so they should not be refactored inside a dependency bump. Worth a tracked tech-debt issue.

@brijeshb42
brijeshb42 enabled auto-merge (squash) June 17, 2026 10:51
@brijeshb42
brijeshb42 disabled auto-merge June 17, 2026 10:57
@brijeshb42
brijeshb42 requested a review from JCQuintas June 17, 2026 10:58
Comment thread vitest.shared.mts Outdated
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jun 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jun 17, 2026
@brijeshb42 brijeshb42 changed the title [code-infra] Bump to latest material-ui [code-infra] Fix lint issues Jun 17, 2026
@brijeshb42
brijeshb42 merged commit 0820e0b into mui:master Jun 17, 2026
21 checks passed
@brijeshb42
brijeshb42 deleted the bump-pkg-versions branch June 17, 2026 15:11
@Janpot

Janpot commented Jun 17, 2026

Copy link
Copy Markdown
Member

Nice, brought render count down on 4 of the benchmarks

Screenshot 2026-06-17 at 17 31 25

mbrookes pushed a commit to mbrookes/mui-x that referenced this pull request Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants