Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we still use this path or why should this be valid?
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.
Ah not sure, I just copied this lint rule into my repo at work cos it's not published, and noticed this inconsistency.
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.
But I think you do:
https://github.com/mui-org/material-ui/blob/4fba0dafd30f608937efa32883d151ba01fc9681/packages/material-ui-lab/src/Alert/Alert.test.js#L3
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.
Tricky. This was never intended to be a public module which is why it is not exported from
test-utils/index
. But let's leave it be for now (since it didn't cause us any trouble after we hid it in a deep import).We should add a
TODO
notice that we this should fail in v5 where we'll move it to our internal/test/utils
.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.
Sorry, that's not what I meant - I copied and pasted the lint rule along with its tests (just in case ESLint 7 comes out and breaks it) into my repo to guard against deep imports in our codebase (I'm trying to make our UMD build depend on yours which means no deep imports and actually led me to #20353), and then as I was familiarising myself with your code & tests, I saw that the condition wasn't being tested :) We don't use this util in our tests, but I'm happy to add the
TODO
.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.
@eps1lon I think that it could be interesting to have this module public, especially for third-party authors that want to enforce the same constraints than our components. For instance, if we didn't plan to move
@material-ui/pickers
into the mono-repository, it would have helped.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.
Sure but this should be another package so that we can properly declare (peer) dependencies. Right now you have to be able to understand the source to be able to make it work. At that point you might as well inline it.
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.
@eps1lon Oh, so like a
@material-ui/test
package? Maybe it's simpler to make it private for now?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.
As I said there's no gain now by making this private now. Let's keep this simple and mark this as undesired and strip out test-utils in v5. We can discuss what's useful in test-utils for other packages in a separate issue (and if this should be a "test" package).
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.
How would you like me to proceed with this?
TODO
to the top of thedescribeConformance
modulecore/test-utils
, update imports, and remove the exclusion from the ESLint rule