Skip to content

[charts][infra] Enable import/no-cycle eslint rules#20554

Merged
JCQuintas merged 7 commits into
mui:masterfrom
JCQuintas:eslint-cyclic
Dec 4, 2025
Merged

[charts][infra] Enable import/no-cycle eslint rules#20554
JCQuintas merged 7 commits into
mui:masterfrom
JCQuintas:eslint-cyclic

Conversation

@JCQuintas

Copy link
Copy Markdown
Member

I was finding cryptic errors when running #20404 in development mode.

It took me a long time to figure out the issue was cyclic deps and fix them, so we might as well enable the plugin instead 😆

The @typescript-eslint/consistent-type-imports is important because type imports are not counted towards cyclic deps, as they are stripped when compiling. This makes it much easier to find the correct cyclic issues, eg: it was something like 400 errors originally and about 27 after.

Screenshot 2025-12-03 at 19 26 48 Screenshot 2025-12-03 at 19 26 14

@JCQuintas JCQuintas self-assigned this Dec 3, 2025
@JCQuintas JCQuintas 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: charts Changes related to the charts. labels Dec 3, 2025
@mui-bot

mui-bot commented Dec 3, 2025

Copy link
Copy Markdown

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

Bundle size report

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 0B(0.00%) ▼-5B(0.00%)
@mui/x-charts-pro 0B(0.00%) 🔺+115B(+0.09%)
@mui/x-charts-premium 0B(0.00%) 🔺+115B(+0.09%)
@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 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 08d8536

@codspeed-hq

codspeed-hq Bot commented Dec 3, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #20554 will not alter performance

Comparing JCQuintas:eslint-cyclic (08d8536) with master (07ee25c)1

Summary

✅ 13 untouched

Footnotes

  1. No successful run was found on master (1231b10) during the generation of this report, so 07ee25c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

return reverse ? !invertStartCoordinate : invertStartCoordinate;
}

export function getBarDimensions(params: {

@JCQuintas JCQuintas Dec 4, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The main cyclic change here was that I had to move this function from packages/x-charts/src/BarChart/useBarPlotData.ts into its own file

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.

Can we isolate the changes in a different PR? Ideally in this PR we'd only enable the ESLint rules and adds the type imports. Otherwise it's impossible to review ~500 files

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You will still have to trust me I didn't change any file though 😆

#20560

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.

It's not a trust question, it's to split code modification from type modification ;)

I 100% trust you to introduce bugs :p

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I 100% trust you to introduce bugs :p

Glad I'm hold to a high standard. It makes me thank my long history of spectacular bug implementations.

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.

You will still have to trust me I didn't change any file though

It isn't about trust 😄 If we're only adding type to imports there's less risk of a revert being necessary. If we bundle a lot of changes and there's an issue, reverting all the type imports would create a ridiculous amount of conflicts.

Might as well separate the changes to make them less risky and so we can more easily revert the more risk parts 😄

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ready for review

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 4, 2025
@github-actions

github-actions Bot commented Dec 4, 2025

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 Dec 4, 2025

@bernardobelchior bernardobelchior 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.

Thank you 😄

@bernardobelchior

Copy link
Copy Markdown
Member

By the way, we PR name is outdated now, I think

@JCQuintas JCQuintas changed the title [charts][infra] Enable import/no-cycle and @typescript-eslint/consistent-type-imports eslint rules [charts][infra] Enable import/no-cycle eslint rules Dec 4, 2025
@JCQuintas JCQuintas merged commit f542edf into mui:master Dec 4, 2025
22 checks passed
@JCQuintas JCQuintas deleted the eslint-cyclic branch December 4, 2025 14:30
A-s-h-o-k pushed a commit to A-s-h-o-k/mui-x that referenced this pull request Dec 14, 2025
mapache-salvaje pushed a commit to mapache-salvaje/mui-x that referenced this pull request Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: charts Changes related to the charts. 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