diff --git a/.changeset/grumpy-poems-grab.md b/.changeset/grumpy-poems-grab.md new file mode 100644 index 0000000000..25b760032e --- /dev/null +++ b/.changeset/grumpy-poems-grab.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-microsoft-calendar': patch +--- + +Added ESLint rule `no-top-level-material-ui-4-imports` in the `microsoft-calender` plugin to migrate the Material UI imports. diff --git a/plugins/microsoft-calendar/.eslintrc.js b/plugins/microsoft-calendar/.eslintrc.js index e2a53a6ad2..a2d8179106 100644 --- a/plugins/microsoft-calendar/.eslintrc.js +++ b/plugins/microsoft-calendar/.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/microsoft-calendar/dev/index.tsx b/plugins/microsoft-calendar/dev/index.tsx index d611bca20c..b419aae0f6 100644 --- a/plugins/microsoft-calendar/dev/index.tsx +++ b/plugins/microsoft-calendar/dev/index.tsx @@ -20,7 +20,7 @@ import { microsoftCalendarApiRef } from '../src'; import responseMock from './mock.json'; import { microsoftAuthApiRef } from '@backstage/core-plugin-api'; import { Content, Page } from '@backstage/core-components'; -import { Grid } from '@material-ui/core'; +import Grid from '@material-ui/core/Grid'; createDevApp() .registerPlugin(microsoftCalendarPlugin) diff --git a/plugins/microsoft-calendar/src/components/AttendeeChip.tsx b/plugins/microsoft-calendar/src/components/AttendeeChip.tsx index 25358519e6..1924b753cd 100644 --- a/plugins/microsoft-calendar/src/components/AttendeeChip.tsx +++ b/plugins/microsoft-calendar/src/components/AttendeeChip.tsx @@ -15,7 +15,9 @@ */ import React from 'react'; -import { Badge, Chip, makeStyles } from '@material-ui/core'; +import Badge from '@material-ui/core/Badge'; +import Chip from '@material-ui/core/Chip'; +import { makeStyles } from '@material-ui/core/styles'; import CancelIcon from '@material-ui/icons/Cancel'; import CheckIcon from '@material-ui/icons/CheckCircle'; import { Attendee, ResponseStatusMap } from '../api'; diff --git a/plugins/microsoft-calendar/src/components/CalendarCard.tsx b/plugins/microsoft-calendar/src/components/CalendarCard.tsx index 8267f9ec43..336cf9219d 100644 --- a/plugins/microsoft-calendar/src/components/CalendarCard.tsx +++ b/plugins/microsoft-calendar/src/components/CalendarCard.tsx @@ -20,7 +20,9 @@ import React, { useState } from 'react'; import { InfoCard, Progress } from '@backstage/core-components'; -import { Box, IconButton, Typography } from '@material-ui/core'; +import Box from '@material-ui/core/Box'; +import IconButton from '@material-ui/core/IconButton'; +import Typography from '@material-ui/core/Typography'; import PrevIcon from '@material-ui/icons/NavigateBefore'; import NextIcon from '@material-ui/icons/NavigateNext'; diff --git a/plugins/microsoft-calendar/src/components/CalendarEvent.tsx b/plugins/microsoft-calendar/src/components/CalendarEvent.tsx index e56e25a09b..255d8cddb7 100644 --- a/plugins/microsoft-calendar/src/components/CalendarEvent.tsx +++ b/plugins/microsoft-calendar/src/components/CalendarEvent.tsx @@ -23,14 +23,12 @@ import React, { useState } from 'react'; import { Link } from '@backstage/core-components'; -import { - Box, - Paper, - Popover, - Tooltip, - Typography, - makeStyles, -} from '@material-ui/core'; +import Box from '@material-ui/core/Box'; +import Paper from '@material-ui/core/Paper'; +import Popover from '@material-ui/core/Popover'; +import Tooltip from '@material-ui/core/Tooltip'; +import Typography from '@material-ui/core/Typography'; +import { makeStyles } from '@material-ui/core/styles'; import webcamIcon from '../icons/webcam.svg'; import { CalendarEventPopoverContent } from './CalendarEventPopoverContent'; diff --git a/plugins/microsoft-calendar/src/components/CalendarEventPopoverContent.tsx b/plugins/microsoft-calendar/src/components/CalendarEventPopoverContent.tsx index 715a1ad276..4106bf3507 100644 --- a/plugins/microsoft-calendar/src/components/CalendarEventPopoverContent.tsx +++ b/plugins/microsoft-calendar/src/components/CalendarEventPopoverContent.tsx @@ -18,14 +18,12 @@ import React from 'react'; import DOMPurify from 'dompurify'; import { Link } from '@backstage/core-components'; -import { - Box, - Divider, - IconButton, - Tooltip, - Typography, - makeStyles, -} from '@material-ui/core'; +import Box from '@material-ui/core/Box'; +import Divider from '@material-ui/core/Divider'; +import IconButton from '@material-ui/core/IconButton'; +import Tooltip from '@material-ui/core/Tooltip'; +import Typography from '@material-ui/core/Typography'; +import { makeStyles } from '@material-ui/core/styles'; import ArrowForwardIcon from '@material-ui/icons/ArrowForward'; import { AttendeeChip } from './AttendeeChip'; diff --git a/plugins/microsoft-calendar/src/components/CalendarSelect.tsx b/plugins/microsoft-calendar/src/components/CalendarSelect.tsx index 59e2376079..0fcb36099d 100644 --- a/plugins/microsoft-calendar/src/components/CalendarSelect.tsx +++ b/plugins/microsoft-calendar/src/components/CalendarSelect.tsx @@ -16,16 +16,14 @@ import { sortBy } from 'lodash'; import React from 'react'; -import { - Checkbox, - FormControl, - Input, - ListItemText, - MenuItem, - Select, - Typography, - makeStyles, -} from '@material-ui/core'; +import Checkbox from '@material-ui/core/Checkbox'; +import FormControl from '@material-ui/core/FormControl'; +import Input from '@material-ui/core/Input'; +import ListItemText from '@material-ui/core/ListItemText'; +import MenuItem from '@material-ui/core/MenuItem'; +import Select from '@material-ui/core/Select'; +import Typography from '@material-ui/core/Typography'; +import { makeStyles } from '@material-ui/core/styles'; import { MicrosoftCalendar } from '../api'; const useStyles = makeStyles( diff --git a/plugins/microsoft-calendar/src/components/SignInContent.tsx b/plugins/microsoft-calendar/src/components/SignInContent.tsx index d33698f68c..8b37a55a5d 100644 --- a/plugins/microsoft-calendar/src/components/SignInContent.tsx +++ b/plugins/microsoft-calendar/src/components/SignInContent.tsx @@ -15,7 +15,9 @@ */ import React from 'react'; -import { Box, Button, styled } from '@material-ui/core'; +import Box from '@material-ui/core/Box'; +import Button from '@material-ui/core/Button'; +import { styled } from '@material-ui/core/styles'; import { CalendarEvent } from './CalendarEvent'; import mockEvents from './eventMock.json'; import { MicrosoftCalendarEvent } from '../api';