diff --git a/.changeset/spotty-ducks-deny.md b/.changeset/spotty-ducks-deny.md new file mode 100644 index 0000000000..964ec9428c --- /dev/null +++ b/.changeset/spotty-ducks-deny.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-tech-insights': patch +--- + +Added ESLint rule `no-top-level-material-ui-4-imports` in the `tech-insights` plugin to migrate the Material UI imports. diff --git a/plugins/tech-insights/.eslintrc.js b/plugins/tech-insights/.eslintrc.js index e2a53a6ad2..a2d8179106 100644 --- a/plugins/tech-insights/.eslintrc.js +++ b/plugins/tech-insights/.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/tech-insights/src/components/ScorecardsContent/ScorecardContent.tsx b/plugins/tech-insights/src/components/ScorecardsContent/ScorecardContent.tsx index f8871b87c1..c144833ea7 100644 --- a/plugins/tech-insights/src/components/ScorecardsContent/ScorecardContent.tsx +++ b/plugins/tech-insights/src/components/ScorecardsContent/ScorecardContent.tsx @@ -21,7 +21,7 @@ import { useApi } from '@backstage/core-plugin-api'; import { ScorecardInfo } from '../ScorecardsInfo'; import Alert from '@material-ui/lab/Alert'; import { techInsightsApiRef } from '../../api/TechInsightsApi'; -import { makeStyles } from '@material-ui/core'; +import { makeStyles } from '@material-ui/core/styles'; import { useEntity } from '@backstage/plugin-catalog-react'; import { getCompoundEntityRef } from '@backstage/catalog-model'; diff --git a/plugins/tech-insights/src/components/ScorecardsInfo/ScorecardInfo.tsx b/plugins/tech-insights/src/components/ScorecardsInfo/ScorecardInfo.tsx index cfff074368..2a2ca982d1 100644 --- a/plugins/tech-insights/src/components/ScorecardsInfo/ScorecardInfo.tsx +++ b/plugins/tech-insights/src/components/ScorecardsInfo/ScorecardInfo.tsx @@ -15,10 +15,12 @@ */ import React from 'react'; -import { makeStyles, Grid, Typography } 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 { InfoCard } from '@backstage/core-components'; import { CheckResult } from '@backstage/plugin-tech-insights-common'; -import { Alert } from '@material-ui/lab'; +import Alert from '@material-ui/lab/Alert'; import { ScorecardsList } from '../ScorecardsList'; const useStyles = makeStyles(theme => ({ diff --git a/plugins/tech-insights/src/components/ScorecardsList/ScorecardsList.tsx b/plugins/tech-insights/src/components/ScorecardsList/ScorecardsList.tsx index 1a9d04a9de..dcd94eb0d7 100644 --- a/plugins/tech-insights/src/components/ScorecardsList/ScorecardsList.tsx +++ b/plugins/tech-insights/src/components/ScorecardsList/ScorecardsList.tsx @@ -16,10 +16,13 @@ import React from 'react'; import { useApi } from '@backstage/core-plugin-api'; -import { makeStyles, List, ListItem, ListItemText } from '@material-ui/core'; +import List from '@material-ui/core/List'; +import ListItem from '@material-ui/core/ListItem'; +import ListItemText from '@material-ui/core/ListItemText'; +import { makeStyles } from '@material-ui/core/styles'; import { techInsightsApiRef } from '../../api'; import { CheckResult } from '@backstage/plugin-tech-insights-common'; -import { Alert } from '@material-ui/lab'; +import Alert from '@material-ui/lab/Alert'; import { MarkdownContent } from '@backstage/core-components'; const useStyles = makeStyles(theme => ({