diff --git a/.changeset/swift-sheep-grow.md b/.changeset/swift-sheep-grow.md new file mode 100644 index 0000000000..17629b1517 --- /dev/null +++ b/.changeset/swift-sheep-grow.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-notifications': patch +--- + +Added ESLint rule `no-top-level-material-ui-4-imports` in the `notifications` plugin to migrate the Material UI imports. diff --git a/plugins/notifications/.eslintrc.js b/plugins/notifications/.eslintrc.js index e2a53a6ad2..a2d8179106 100644 --- a/plugins/notifications/.eslintrc.js +++ b/plugins/notifications/.eslintrc.js @@ -1 +1,5 @@ -module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); +module.exports = require('@backstage/cli/config/eslint-factory')(__dirname, { + rules: { + '@backstage/no-top-level-material-ui-4-imports': 'error', + }, +}); diff --git a/plugins/notifications/src/components/NotificationsFilters/NotificationsFilters.tsx b/plugins/notifications/src/components/NotificationsFilters/NotificationsFilters.tsx index caf966eab3..3175af6f6f 100644 --- a/plugins/notifications/src/components/NotificationsFilters/NotificationsFilters.tsx +++ b/plugins/notifications/src/components/NotificationsFilters/NotificationsFilters.tsx @@ -15,15 +15,13 @@ */ import React from 'react'; -import { - Divider, - FormControl, - Grid, - InputLabel, - MenuItem, - Select, - Typography, -} from '@material-ui/core'; +import Divider from '@material-ui/core/Divider'; +import FormControl from '@material-ui/core/FormControl'; +import Grid from '@material-ui/core/Grid'; +import InputLabel from '@material-ui/core/InputLabel'; +import MenuItem from '@material-ui/core/MenuItem'; +import Select from '@material-ui/core/Select'; +import Typography from '@material-ui/core/Typography'; import { GetNotificationsOptions } from '../../api'; import { NotificationSeverity } from '@backstage/plugin-notifications-common'; diff --git a/plugins/notifications/src/components/NotificationsPage/NotificationsPage.tsx b/plugins/notifications/src/components/NotificationsPage/NotificationsPage.tsx index e3ad27d40a..8ff9983d02 100644 --- a/plugins/notifications/src/components/NotificationsPage/NotificationsPage.tsx +++ b/plugins/notifications/src/components/NotificationsPage/NotificationsPage.tsx @@ -20,7 +20,7 @@ import { PageWithHeader, ResponseErrorPanel, } from '@backstage/core-components'; -import { Grid } from '@material-ui/core'; +import Grid from '@material-ui/core/Grid'; import { useSignal } from '@backstage/plugin-signals-react'; import { NotificationsTable } from '../NotificationsTable'; diff --git a/plugins/notifications/src/components/NotificationsTable/NotificationsTable.tsx b/plugins/notifications/src/components/NotificationsTable/NotificationsTable.tsx index 8012451cc9..733fd7f503 100644 --- a/plugins/notifications/src/components/NotificationsTable/NotificationsTable.tsx +++ b/plugins/notifications/src/components/NotificationsTable/NotificationsTable.tsx @@ -17,7 +17,11 @@ import React, { useMemo } from 'react'; import throttle from 'lodash/throttle'; // @ts-ignore import RelativeTime from 'react-relative-time'; -import { Box, Grid, IconButton, Tooltip, Typography } from '@material-ui/core'; +import Box from '@material-ui/core/Box'; +import Grid from '@material-ui/core/Grid'; +import IconButton from '@material-ui/core/IconButton'; +import Tooltip from '@material-ui/core/Tooltip'; +import Typography from '@material-ui/core/Typography'; import { Notification } from '@backstage/plugin-notifications-common'; import { notificationsApiRef } from '../../api';