Skip to content

Commit 2f481a0

Browse files
[core] Remove custom hooks from the mui-name-matches-component-name linting rule (#42773)
1 parent cea9671 commit 2f481a0

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

.eslintrc.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -446,16 +446,7 @@ module.exports = {
446446
files: ['packages/*/src/**/*{.ts,.tsx,.js}'],
447447
excludedFiles: ['*.d.ts', '*.spec.ts', '*.spec.tsx', 'packages/mui-joy/**/*{.ts,.tsx,.js}'],
448448
rules: {
449-
'material-ui/mui-name-matches-component-name': [
450-
'error',
451-
{
452-
customHooks: [
453-
'useDatePickerDefaultizedProps',
454-
'useDateTimePickerDefaultizedProps',
455-
'useTimePickerDefaultizedProps',
456-
],
457-
},
458-
],
449+
'material-ui/mui-name-matches-component-name': 'error',
459450
},
460451
},
461452
{

packages/eslint-plugin-material-ui/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Custom eslint rules for MUI.
66

77
- `disallow-active-element-as-key-event-target`
88
- `docgen-ignore-before-comment`
9+
- `mui-name-matches-component-name`
910
- `no-hardcoded-labels`
1011
- `rules-of-use-theme-variants`
1112
- ~~`restricted-path-imports`~~
@@ -20,6 +21,10 @@ we use already verifies that the passed target can be the target of a
2021

2122
Enforce correct usage of `@ignore` in the prop-types block comments.
2223

24+
### mui-name-matches-component-name
25+
26+
Enforce that the name passed to the `useThemeProps` and `useDefaultProps` hooks matches the component name.
27+
2328
### no-hardcoded-labels
2429

2530
Prevent the usage of hardcoded labels.

0 commit comments

Comments
 (0)