diff --git a/.changeset/purple-seals-rest.md b/.changeset/purple-seals-rest.md new file mode 100644 index 0000000000..7ed827fd33 --- /dev/null +++ b/.changeset/purple-seals-rest.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-kubernetes-cluster': patch +--- + +Added ESLint rule `no-top-level-material-ui-4-imports` in the `kubernetes-cluster` plugin to migrate the Material UI imports. diff --git a/plugins/kubernetes-cluster/.eslintrc.js b/plugins/kubernetes-cluster/.eslintrc.js index e2a53a6ad2..a2d8179106 100644 --- a/plugins/kubernetes-cluster/.eslintrc.js +++ b/plugins/kubernetes-cluster/.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/kubernetes-cluster/src/components/ApiResources/ApiResources.tsx b/plugins/kubernetes-cluster/src/components/ApiResources/ApiResources.tsx index f6e8bc65ce..c122214a31 100644 --- a/plugins/kubernetes-cluster/src/components/ApiResources/ApiResources.tsx +++ b/plugins/kubernetes-cluster/src/components/ApiResources/ApiResources.tsx @@ -19,7 +19,7 @@ import { useEntity } from '@backstage/plugin-catalog-react'; import { Table, TableColumn } from '@backstage/core-components'; import { IAPIGroup } from '@kubernetes-models/apimachinery/apis/meta/v1'; import { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext'; -import { makeStyles } from '@material-ui/core'; +import { makeStyles } from '@material-ui/core/styles'; const useStyles = makeStyles(theme => ({ empty: { diff --git a/plugins/kubernetes-cluster/src/components/ClusterOverview/ClusterOverview.tsx b/plugins/kubernetes-cluster/src/components/ClusterOverview/ClusterOverview.tsx index a4d4ffc40c..b77b2dff88 100644 --- a/plugins/kubernetes-cluster/src/components/ClusterOverview/ClusterOverview.tsx +++ b/plugins/kubernetes-cluster/src/components/ClusterOverview/ClusterOverview.tsx @@ -17,8 +17,8 @@ import React, { useCallback, useEffect } from 'react'; import { InfoCard, StructuredMetadataTable } from '@backstage/core-components'; import { useEntity } from '@backstage/plugin-catalog-react'; import { useCluster } from './useCluster'; -import { Skeleton } from '@material-ui/lab'; -import { Theme, createStyles, makeStyles } from '@material-ui/core'; +import Skeleton from '@material-ui/lab/Skeleton'; +import { Theme, createStyles, makeStyles } from '@material-ui/core/styles'; import { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext'; const useStyles = makeStyles((_theme: Theme) => diff --git a/plugins/kubernetes-cluster/src/components/KubernetesClusterContent/KubernetesClusterContent.tsx b/plugins/kubernetes-cluster/src/components/KubernetesClusterContent/KubernetesClusterContent.tsx index 665ca2acdd..c46ac4c8e2 100644 --- a/plugins/kubernetes-cluster/src/components/KubernetesClusterContent/KubernetesClusterContent.tsx +++ b/plugins/kubernetes-cluster/src/components/KubernetesClusterContent/KubernetesClusterContent.tsx @@ -15,7 +15,8 @@ */ import React from 'react'; import { ApiResources } from '../ApiResources/ApiResources'; -import { Grid, Typography } from '@material-ui/core'; +import Grid from '@material-ui/core/Grid'; +import Typography from '@material-ui/core/Typography'; import { Nodes } from '../Nodes/Nodes'; import { ClusterOverview } from '../ClusterOverview'; import { diff --git a/plugins/kubernetes-cluster/src/components/Nodes/Nodes.tsx b/plugins/kubernetes-cluster/src/components/Nodes/Nodes.tsx index e7f6e957ae..0b3f7ddb60 100644 --- a/plugins/kubernetes-cluster/src/components/Nodes/Nodes.tsx +++ b/plugins/kubernetes-cluster/src/components/Nodes/Nodes.tsx @@ -22,7 +22,9 @@ import { TableColumn, } from '@backstage/core-components'; import { INode } from 'kubernetes-models/v1'; -import { Grid, Typography, makeStyles } from '@material-ui/core'; +import Grid from '@material-ui/core/Grid'; +import Typography from '@material-ui/core/Typography'; +import { makeStyles } from '@material-ui/core/styles'; import { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext'; import { KubernetesDrawer } from '@backstage/plugin-kubernetes-react';