diff --git a/.changeset/sweet-planets-relate.md b/.changeset/sweet-planets-relate.md new file mode 100644 index 0000000000..7697874957 --- /dev/null +++ b/.changeset/sweet-planets-relate.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-org-react': patch +--- + +Added the `no-top-level-material-ui-4-imports` ESLint rule to aid with the migration to Material UI v5 diff --git a/plugins/org-react/.eslintrc.js b/plugins/org-react/.eslintrc.js index e2a53a6ad2..e487f765b2 100644 --- a/plugins/org-react/.eslintrc.js +++ b/plugins/org-react/.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/org-react/src/components/GroupListPicker/GroupListPickerButton.tsx b/plugins/org-react/src/components/GroupListPicker/GroupListPickerButton.tsx index f4255a18be..b7a31f89f2 100644 --- a/plugins/org-react/src/components/GroupListPicker/GroupListPickerButton.tsx +++ b/plugins/org-react/src/components/GroupListPicker/GroupListPickerButton.tsx @@ -15,7 +15,9 @@ */ import React from 'react'; -import { makeStyles, Typography, Button } from '@material-ui/core'; +import Typography from '@material-ui/core/Typography'; +import Button from '@material-ui/core/Button'; +import { makeStyles } from '@material-ui/core/styles'; import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown'; import PeopleIcon from '@material-ui/icons/People';