Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Refactor ESLint config to disallow root level imports #13130

Merged
merged 10 commits into from
May 15, 2024

Conversation

LukasTy
Copy link
Member

@LukasTy LukasTy commented May 14, 2024

Follow-up on #13120.

  • Add @mui/x-codemod to ESLInt no-restricted-imports rule
  • Fix ESLint no-restricted-imports rule config for @mui/x-date-pickers* packages <-- did not work now
  • Add ESLint no-restricted-imports rule config to disallow root level package imports
    • omit @mui/x-data-grid* and @mui/x-license packages
  • Update imports in demos and other impacted locations
  • Export UseDateRangeFieldProps from @mui/x-date-pickers-pro/models to avoid the need for public root import
  • Export LocalizationProvider from @mui/x-date-pickers-pro/LocalizationProvider to avoid the need for public root import

@LukasTy LukasTy added core Infrastructure work going on behind the scenes component: pickers This is the name of the generic UI component, not the React module! labels May 14, 2024
@LukasTy LukasTy self-assigned this May 14, 2024
@mui-bot
Copy link

mui-bot commented May 14, 2024

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

Generated by 🚫 dangerJS against 78e7fe1

@LukasTy LukasTy added the docs Improvements or additions to the documentation label May 14, 2024
@LukasTy
Copy link
Member Author

LukasTy commented May 14, 2024

It impacts charts docs a lot, hence, I've asked for a review from @alexfauquette and @JCQuintas. 😉

Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

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

Looks good for charts 👍

Comment on lines +5 to +6
import { PaperProps as MuiPaperProps } from '@mui/material/Paper';
import { TransitionProps as MuiTransitionProps } from '@mui/material/transitions';
Copy link
Member Author

Choose a reason for hiding this comment

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

These are almost a "bugfix". 🙈

Comment on lines +215 to +216
...buildPackageRestrictedImports('@mui/x-date-pickers', 'x-date-pickers', false),
...buildPackageRestrictedImports('@mui/x-date-pickers-pro', 'x-date-pickers-pro', false),
Copy link
Member Author

Choose a reason for hiding this comment

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

Notice the package name and path fixes - technically ESLint was not working on Pickers packages

Copy link
Member

@flaviendelangle flaviendelangle left a comment

Choose a reason for hiding this comment

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

🤩 That's awesome

@LukasTy LukasTy merged commit 956f8bd into mui:master May 15, 2024
17 checks passed
@LukasTy LukasTy deleted the fix-eslint branch May 15, 2024 07:59
arthurbalduini pushed a commit to arthurbalduini/mui-x that referenced this pull request May 23, 2024
DungTiger pushed a commit to DungTiger/mui-x that referenced this pull request Jul 23, 2024
thomasmoon pushed a commit to thomasmoon/mui-x that referenced this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! core Infrastructure work going on behind the scenes docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants