Skip to content

Commit

Permalink
test: Enable react/no-unstable-nested-components
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Sep 29, 2022
1 parent d5d7188 commit bfde5b2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Expand Up @@ -160,6 +160,8 @@ module.exports = {
'react/state-in-constructor': 'off',
// stylistic opinion. For conditional assignment we want it outside, otherwise as static
'react/static-property-placement': 'off',
// Currently not in recommended ruleset but catches real bugs.
'react/no-unstable-nested-components': 'error',
},
overrides: [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material-next/src/Button/Button.spec.tsx
Expand Up @@ -11,7 +11,7 @@ const TestOverride = React.forwardRef<HTMLDivElement, { x?: number }>((props, re

const FakeIcon = () => <div>Icon</div>;

const ButtonTest = () => (
const buttonTest = () => (
<div>
<Button>I am a button!</Button>
<Button color="inherit">Contrast</Button>
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/Button/Button.spec.tsx
Expand Up @@ -11,7 +11,7 @@ const TestOverride = React.forwardRef<HTMLDivElement, { x?: number }>((props, re

const FakeIcon = () => <div>Icon</div>;

const ButtonTest = () => (
const buttonTest = () => (
<div>
<Button>I am a button!</Button>
<Button color="inherit">Contrast</Button>
Expand Down
@@ -1,7 +1,7 @@
import * as React from 'react';
import { DialogContentText } from '@mui/material';

const DialogContentTextTest = () => {
const dialogContentTextTest = () => {
const CustomComponent: React.FC<{ prop1: string; prop2: number }> = () => <div />;
return (
<div>
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/Typography/typography.spec.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
import { Typography } from '@mui/material';

const TypographyTest = () => {
const typographyTest = () => {
const CustomComponent: React.FC<{ prop1: string; prop2: number }> = () => <div />;
return (
<div>
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/test/typescript/components.spec.tsx
Expand Up @@ -167,7 +167,7 @@ const BottomNavigationTest = () => {
);
};

const IconButtonTest = () => (
const iconButtonTest = () => (
<div>
<IconButton aria-label="delete">
<FakeIcon />
Expand Down

0 comments on commit bfde5b2

Please sign in to comment.