diff --git a/.changeset/unlucky-clouds-wash.md b/.changeset/unlucky-clouds-wash.md new file mode 100644 index 0000000000..15f0f42ee7 --- /dev/null +++ b/.changeset/unlucky-clouds-wash.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-gocd': patch +--- + +Added an optional ESLint rule - no-top-level-material-ui-4-imports -in gocd plugin which has an auto fix function to migrate the imports and used it to migrate the Material UI imports for plugins/gocd. diff --git a/plugins/gocd/.eslintrc.js b/plugins/gocd/.eslintrc.js index e2a53a6ad2..9d5b45a010 100644 --- a/plugins/gocd/.eslintrc.js +++ b/plugins/gocd/.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/gocd/src/components/GoCdBuildsInsights/GoCdBuildsInsights.tsx b/plugins/gocd/src/components/GoCdBuildsInsights/GoCdBuildsInsights.tsx index 20336fe6ac..042478b03a 100644 --- a/plugins/gocd/src/components/GoCdBuildsInsights/GoCdBuildsInsights.tsx +++ b/plugins/gocd/src/components/GoCdBuildsInsights/GoCdBuildsInsights.tsx @@ -21,14 +21,12 @@ import { toBuildResultStatus, GoCdBuildResultStatus, } from '../../api/gocdApi.model'; -import { - Box, - Grid, - Card, - CardContent, - Tooltip, - Typography, -} from '@material-ui/core'; +import Box from '@material-ui/core/Box'; +import Grid from '@material-ui/core/Grid'; +import Card from '@material-ui/core/Card'; +import CardContent from '@material-ui/core/CardContent'; +import Tooltip from '@material-ui/core/Tooltip'; +import Typography from '@material-ui/core/Typography'; import { DateTime, Duration } from 'luxon'; export type GoCdBuildsInsightsProps = { diff --git a/plugins/gocd/src/components/GoCdBuildsTable/GoCdBuildsTable.tsx b/plugins/gocd/src/components/GoCdBuildsTable/GoCdBuildsTable.tsx index 498cdc26bf..6126ece1fd 100644 --- a/plugins/gocd/src/components/GoCdBuildsTable/GoCdBuildsTable.tsx +++ b/plugins/gocd/src/components/GoCdBuildsTable/GoCdBuildsTable.tsx @@ -16,8 +16,8 @@ import React, { useState } from 'react'; import { Entity, getEntitySourceLocation } from '@backstage/catalog-model'; import { useEntity } from '@backstage/plugin-catalog-react'; -import { Alert } from '@material-ui/lab'; -import { Button } from '@material-ui/core'; +import Alert from '@material-ui/lab/Alert'; +import Button from '@material-ui/core/Button'; import GitHubIcon from '@material-ui/icons/GitHub'; import { GoCdBuildResult,