-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] Fix eslint no-restricted-imports
rule application
#13401
base: master
Are you sure you want to change the base?
Conversation
Deploy preview: https://deploy-preview-13401--material-ui-x.netlify.app/ |
bfd45e5
to
82a10c8
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
@@ -1,7 +1,7 @@ | |||
import * as React from 'react'; | |||
import Box from '@mui/material/Box'; | |||
import Rating from '@mui/material/Rating'; | |||
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils'; | |||
import useEnhancedEffect from '@mui/utils/useEnhancedEffect'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This modification looks weird, because nothing indicates that this hook is unstable.
Not an issue in the package code, but it the docs, I'm not sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One could say that we should not even use @mui/utils
in the doc since it's meant to be an internal package, but we are doing it extensively 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem solved? 😁
import useEnhancedEffect from '@mui/utils/useEnhancedEffect'; | |
import unstable_useEnhancedEffect from '@mui/utils/useEnhancedEffect'; |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
|
||
// Rules only impacting bundled files and doc files | ||
{ | ||
files: ['packages/*/src/**/*{.ts,.tsx,.js}', 'docs/data/**/*{.ts,.tsx,.js}'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that we don't need this. This should be coming from the monorepo root eslint configuration since there doesn't seem to be anything specific about MUI X.
files: ['packages/*/src/**/*{.ts,.tsx,.js}', 'docs/data/**/*{.ts,.tsx,.js}'], |
I think the recent changes broke the linting because
no-restricted-imports
does not work well when applied several time (the last one tends to override the previous ones).@mui/utils
root in all our packages / doc / test files@mui/material
root in all our packages / doc / test filesimport { DateRange } from '@mui/x-date-pickers/internals/models'
) in all our packages / doc files (the test files can do it to avoid exporting stuff just because some test uses it@LukasTy if you see any weird behavior I'm of course interested, I tested a few imports and it seems to be consistent