Skip to content

Commit

Permalink
[core] Remove custom hooks from the mui-name-matches-component-name
Browse files Browse the repository at this point in the history
… linting rule (mui#42773)
  • Loading branch information
flaviendelangle authored and joserodolfofreitas committed Jul 29, 2024
1 parent 8563551 commit 5e0e7ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
11 changes: 1 addition & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,16 +446,7 @@ module.exports = {
files: ['packages/*/src/**/*{.ts,.tsx,.js}'],
excludedFiles: ['*.d.ts', '*.spec.ts', '*.spec.tsx', 'packages/mui-joy/**/*{.ts,.tsx,.js}'],
rules: {
'material-ui/mui-name-matches-component-name': [
'error',
{
customHooks: [
'useDatePickerDefaultizedProps',
'useDateTimePickerDefaultizedProps',
'useTimePickerDefaultizedProps',
],
},
],
'material-ui/mui-name-matches-component-name': 'error',
},
},
{
Expand Down
5 changes: 5 additions & 0 deletions packages/eslint-plugin-material-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Custom eslint rules for MUI.

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

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

### mui-name-matches-component-name

Enforce that the name passed to the `useThemeProps` and `useDefaultProps` hooks matches the component name.

### no-hardcoded-labels

Prevent the usage of hardcoded labels.
Expand Down

0 comments on commit 5e0e7ed

Please sign in to comment.