mui / material-ui

Material UI: Ready-to-use foundational React components, free forever. It includes Material UI, which implements Google's Material Design.
https://mui.com/material-ui/
MIT License
91.73k stars 31.51k forks source link

[core] Restrict import path with ESLint #41970

Closed oliviertassinari closed 4 days ago

oliviertassinari commented 2 weeks ago

A step to fix https://github.com/mui/mui-toolpad/pull/3417/files#r1572992179 at the root.

https://eslint.org/docs/latest/rules/no-restricted-imports

mui-bot commented 2 weeks ago

Netlify deploy preview

https://deploy-preview-41970--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad) No bundle size changes

Generated by :no_entry_sign: dangerJS against 7a8175dd5952518f4783bef0f4e8c76203941cd3

Janpot commented 1 week ago

I suspect that our move to the exports field in package json will make this rule largely irrelevant. When those deep imports simply don't exist anymore in the world of typescript. And consequently vscode won't suggest it anymore neither in its auto-import.

oliviertassinari commented 1 week ago

Oh yes, this will be great once we have package.json exports 🙌. We will need to fix the violations we have in the codebase to get there. I think rule will help us get there, e.g. If MUI X relies on private modules, best to caught it before we break them 😁

Janpot commented 1 week ago

Yes, we decided to test more integrations before merging and we're running into a few issues. e.g. I suspect this one will be a blocker https://github.com/vercel/next.js/issues/64796.