[test] Lint useThemeVariants with custom rules plugin #21963
Merged
+238
−0
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.
Resolves #21648 (comment)
Changed quite a bit from the original implementation.
Test explain best what valid and invalid patterns are caught: https://github.com/eps1lon/material-ui/blob/test/lint-usethemevariants/packages/eslint-plugin-material-ui/src/rules/rules-of-use-theme-variants.test.js
Change to existing code is meant as a sanity check for the rule. CI should fail since we no longer pass the resolved value of
disabled
inButton
touseThemeVariants
.Edit: Fails as expected: https://app.circleci.com/pipelines/github/mui-org/material-ui/16138/workflows/d1b315c8-315b-460c-bd10-7c40dcb27f26/jobs/166269/parallel-runs/0/steps/0-113