diff --git a/.changeset/small-wasps-perform.md b/.changeset/small-wasps-perform.md new file mode 100644 index 0000000000..cdcea1ba98 --- /dev/null +++ b/.changeset/small-wasps-perform.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-code-climate': patch +--- + +Added ESLint rule `no-top-level-material-ui-4-imports` in the Code-Climate plugin to migrate the Material UI imports. diff --git a/plugins/code-climate/.eslintrc.js b/plugins/code-climate/.eslintrc.js index e2a53a6ad2..a2d8179106 100644 --- a/plugins/code-climate/.eslintrc.js +++ b/plugins/code-climate/.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/code-climate/dev/index.tsx b/plugins/code-climate/dev/index.tsx index 060679337e..46619dcbeb 100644 --- a/plugins/code-climate/dev/index.tsx +++ b/plugins/code-climate/dev/index.tsx @@ -17,7 +17,7 @@ import { Entity } from '@backstage/catalog-model'; // eslint-disable-next-line @backstage/no-undeclared-imports import { createDevApp, EntityGridItem } from '@backstage/dev-utils'; -import { Grid } from '@material-ui/core'; +import Grid from '@material-ui/core/Grid'; import React from 'react'; import { EntityCodeClimateCard, diff --git a/plugins/code-climate/src/components/CodeClimateTable/CodeClimateTable.tsx b/plugins/code-climate/src/components/CodeClimateTable/CodeClimateTable.tsx index ca5b24565c..ebb13abfbc 100644 --- a/plugins/code-climate/src/components/CodeClimateTable/CodeClimateTable.tsx +++ b/plugins/code-climate/src/components/CodeClimateTable/CodeClimateTable.tsx @@ -17,7 +17,9 @@ import React from 'react'; import { CodeClimateData } from '../../api'; import { Link } from '@backstage/core-components'; -import { Box, makeStyles, Theme, Typography } from '@material-ui/core'; +import Box from '@material-ui/core/Box'; +import Typography from '@material-ui/core/Typography'; +import { makeStyles, Theme } from '@material-ui/core/styles'; const letterStyle = (theme: Theme) => ({ color: theme.palette.common.white,