From 9c9e0a10d926a81d9330126fd00a82ea3aec3586 Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Fri, 15 Mar 2024 12:45:22 +0530 Subject: [PATCH 1/4] Add ESLint Rule to Gcalendar Plugin Signed-off-by: Aditya Kumar --- .changeset/healthy-suits-fetch.md | 5 +++++ plugins/gcalendar/.eslintrc.js | 6 +++++- .../components/CalendarCard/AttendeeChip.tsx | 4 +++- .../components/CalendarCard/CalendarCard.tsx | 4 +++- .../components/CalendarCard/CalendarEvent.tsx | 14 ++++++-------- .../CalendarEventPopoverContent.tsx | 14 ++++++-------- .../components/CalendarCard/CalendarSelect.tsx | 18 ++++++++---------- .../components/CalendarCard/SignInContent.tsx | 4 +++- 8 files changed, 39 insertions(+), 30 deletions(-) create mode 100644 .changeset/healthy-suits-fetch.md diff --git a/.changeset/healthy-suits-fetch.md b/.changeset/healthy-suits-fetch.md new file mode 100644 index 0000000000..3477679d8f --- /dev/null +++ b/.changeset/healthy-suits-fetch.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-gcalendar': patch +--- + +Added ESLint rule `no-top-level-material-ui-4-imports` in the GCalendar plugin to migrate the Material UI imports. diff --git a/plugins/gcalendar/.eslintrc.js b/plugins/gcalendar/.eslintrc.js index e2a53a6ad2..91d571d5ed 100644 --- a/plugins/gcalendar/.eslintrc.js +++ b/plugins/gcalendar/.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', + }, +}); \ No newline at end of file diff --git a/plugins/gcalendar/src/components/CalendarCard/AttendeeChip.tsx b/plugins/gcalendar/src/components/CalendarCard/AttendeeChip.tsx index 9008f263bf..184a5b0a27 100644 --- a/plugins/gcalendar/src/components/CalendarCard/AttendeeChip.tsx +++ b/plugins/gcalendar/src/components/CalendarCard/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 { EventAttendee, ResponseStatus } from '../../api'; diff --git a/plugins/gcalendar/src/components/CalendarCard/CalendarCard.tsx b/plugins/gcalendar/src/components/CalendarCard/CalendarCard.tsx index 26d6f1eed0..e26e245174 100644 --- a/plugins/gcalendar/src/components/CalendarCard/CalendarCard.tsx +++ b/plugins/gcalendar/src/components/CalendarCard/CalendarCard.tsx @@ -21,7 +21,9 @@ import React, { useState } from 'react'; import { InfoCard, Progress } from '@backstage/core-components'; import { useAnalytics } from '@backstage/core-plugin-api'; -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/gcalendar/src/components/CalendarCard/CalendarEvent.tsx b/plugins/gcalendar/src/components/CalendarCard/CalendarEvent.tsx index 5ea538df86..d1c9791354 100644 --- a/plugins/gcalendar/src/components/CalendarCard/CalendarEvent.tsx +++ b/plugins/gcalendar/src/components/CalendarCard/CalendarEvent.tsx @@ -24,14 +24,12 @@ import React, { useState } from 'react'; import { useAnalytics } from '@backstage/core-plugin-api'; 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 zoomIcon from '../../icons/zoomIcon.svg'; import { CalendarEventPopoverContent } from './CalendarEventPopoverContent'; diff --git a/plugins/gcalendar/src/components/CalendarCard/CalendarEventPopoverContent.tsx b/plugins/gcalendar/src/components/CalendarCard/CalendarEventPopoverContent.tsx index 45e793470b..36dfa493e4 100644 --- a/plugins/gcalendar/src/components/CalendarCard/CalendarEventPopoverContent.tsx +++ b/plugins/gcalendar/src/components/CalendarCard/CalendarEventPopoverContent.tsx @@ -19,14 +19,12 @@ import DOMPurify from 'dompurify'; import { useAnalytics } from '@backstage/core-plugin-api'; 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/gcalendar/src/components/CalendarCard/CalendarSelect.tsx b/plugins/gcalendar/src/components/CalendarCard/CalendarSelect.tsx index cd48d9ad3e..cd69db2230 100644 --- a/plugins/gcalendar/src/components/CalendarCard/CalendarSelect.tsx +++ b/plugins/gcalendar/src/components/CalendarCard/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 { GCalendar } from '../../api'; diff --git a/plugins/gcalendar/src/components/CalendarCard/SignInContent.tsx b/plugins/gcalendar/src/components/CalendarCard/SignInContent.tsx index 544d761102..4e1690cd84 100644 --- a/plugins/gcalendar/src/components/CalendarCard/SignInContent.tsx +++ b/plugins/gcalendar/src/components/CalendarCard/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 { eventsMock } from './signInEventMock'; import { GCalendarEvent } from '../../api'; From c501ccb04a6ff46f6f5b1d9c8ee1b88ca004919f Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Fri, 15 Mar 2024 12:50:47 +0530 Subject: [PATCH 2/4] Add ESLint Rule to Gcalendar Plugin Signed-off-by: Aditya Kumar --- plugins/gcalendar/.eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/gcalendar/.eslintrc.js b/plugins/gcalendar/.eslintrc.js index 91d571d5ed..8a594f42ab 100644 --- a/plugins/gcalendar/.eslintrc.js +++ b/plugins/gcalendar/.eslintrc.js @@ -2,4 +2,4 @@ module.exports = require('@backstage/cli/config/eslint-factory')(__dirname, { rules: { '@backstage/no-top-level-material-ui-4-imports': 'error', }, -}); \ No newline at end of file +}); From 73c39a092a51b82f45dba681ad75c271531f6b49 Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Fri, 15 Mar 2024 13:07:00 +0530 Subject: [PATCH 3/4] Add ESLint Rule to Gcalendar Plugin Signed-off-by: Aditya Kumar --- .changeset/healthy-suits-fetch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/healthy-suits-fetch.md b/.changeset/healthy-suits-fetch.md index 3477679d8f..600b9fb93c 100644 --- a/.changeset/healthy-suits-fetch.md +++ b/.changeset/healthy-suits-fetch.md @@ -2,4 +2,4 @@ '@backstage/plugin-gcalendar': patch --- -Added ESLint rule `no-top-level-material-ui-4-imports` in the GCalendar plugin to migrate the Material UI imports. +Added ESLint rule `no-top-level-material-ui-4-imports` in the gcalendar plugin to migrate the Material UI imports. From 6edc412b97d009797a9f90fcc38cd665abdf3e99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 15 Mar 2024 10:29:52 +0100 Subject: [PATCH 4/4] Update .changeset/healthy-suits-fetch.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/healthy-suits-fetch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/healthy-suits-fetch.md b/.changeset/healthy-suits-fetch.md index 600b9fb93c..29ff940b8f 100644 --- a/.changeset/healthy-suits-fetch.md +++ b/.changeset/healthy-suits-fetch.md @@ -2,4 +2,4 @@ '@backstage/plugin-gcalendar': patch --- -Added ESLint rule `no-top-level-material-ui-4-imports` in the gcalendar plugin to migrate the Material UI imports. +Added ESLint rule `no-top-level-material-ui-4-imports` in the `gcalendar` plugin to migrate the Material UI imports.