From a1ddc8da2093462ccb6d2ea36c766b47a12cf4c9 Mon Sep 17 00:00:00 2001 From: AmbrishRamachandiran Date: Thu, 21 Mar 2024 10:56:07 +0530 Subject: [PATCH 1/3] Add ESLint Rule to Github-Deployments Plugin Signed-off-by: AmbrishRamachandiran --- .changeset/slimy-panthers-yawn.md | 5 +++++ plugins/github-deployments/.eslintrc.js | 6 +++++- .../GithubDeploymentsTable/GithubDeploymentsTable.tsx | 3 ++- .../src/components/GithubDeploymentsTable/columns.tsx | 3 ++- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .changeset/slimy-panthers-yawn.md diff --git a/.changeset/slimy-panthers-yawn.md b/.changeset/slimy-panthers-yawn.md new file mode 100644 index 0000000000..d327364e81 --- /dev/null +++ b/.changeset/slimy-panthers-yawn.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-github-deployments': minor +--- + +Added ESLint rule `no-top-level-material-ui-4-imports` in the `github-deployments` plugin to migrate the Material UI imports. diff --git a/plugins/github-deployments/.eslintrc.js b/plugins/github-deployments/.eslintrc.js index e2a53a6ad2..a2d8179106 100644 --- a/plugins/github-deployments/.eslintrc.js +++ b/plugins/github-deployments/.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/github-deployments/src/components/GithubDeploymentsTable/GithubDeploymentsTable.tsx b/plugins/github-deployments/src/components/GithubDeploymentsTable/GithubDeploymentsTable.tsx index 61295abff0..3f37646656 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsTable/GithubDeploymentsTable.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsTable/GithubDeploymentsTable.tsx @@ -15,7 +15,8 @@ */ import React from 'react'; import { GithubDeployment } from '../../api'; -import { Typography, makeStyles } from '@material-ui/core'; +import Typography from '@material-ui/core/Typography'; +import { makeStyles } from '@material-ui/core/styles'; import SyncIcon from '@material-ui/icons/Sync'; import { columnFactories } from './columns'; import { defaultDeploymentColumns } from './presets'; diff --git a/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx b/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx index 5dffdd9089..04208f3b39 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx @@ -17,7 +17,8 @@ import React from 'react'; import { GithubDeployment } from '../../api'; import { DateTime } from 'luxon'; -import { Box, Typography } from '@material-ui/core'; +import Box from '@material-ui/core/Box'; +import Typography from '@material-ui/core/Typography'; import { StatusPending, StatusRunning, From 45a57950576a9dcb097f55326253451e3fa10154 Mon Sep 17 00:00:00 2001 From: AmbrishRamachandiran Date: Thu, 21 Mar 2024 11:10:10 +0530 Subject: [PATCH 2/3] Fixed lint issue Signed-off-by: AmbrishRamachandiran --- .../src/components/GithubDeploymentsCard.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/github-deployments/src/components/GithubDeploymentsCard.test.tsx b/plugins/github-deployments/src/components/GithubDeploymentsCard.test.tsx index 1f354914bb..d60034ebfc 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsCard.test.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsCard.test.tsx @@ -41,7 +41,7 @@ import { graphql } from 'msw'; import { ScmIntegrations } from '@backstage/integration'; import { Entity } from '@backstage/catalog-model'; import { GithubDeploymentsTable } from './GithubDeploymentsTable'; -import { Box } from '@material-ui/core'; +import Box from '@material-ui/core/Box'; import { ApiProvider, ConfigReader } from '@backstage/core-app-api'; import { From a7195377c4691f8d9638d656aa65a1804f094e9c Mon Sep 17 00:00:00 2001 From: Ambrish R Date: Thu, 21 Mar 2024 13:02:50 +0530 Subject: [PATCH 3/3] Update slimy-panthers-yawn.md changeset minor to patch Signed-off-by: Ambrish R --- .changeset/slimy-panthers-yawn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/slimy-panthers-yawn.md b/.changeset/slimy-panthers-yawn.md index d327364e81..1a709bbf6b 100644 --- a/.changeset/slimy-panthers-yawn.md +++ b/.changeset/slimy-panthers-yawn.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-github-deployments': minor +'@backstage/plugin-github-deployments': patch --- Added ESLint rule `no-top-level-material-ui-4-imports` in the `github-deployments` plugin to migrate the Material UI imports.