diff --git a/.changeset/breezy-socks-mix.md b/.changeset/breezy-socks-mix.md new file mode 100644 index 0000000000..0c6e77c836 --- /dev/null +++ b/.changeset/breezy-socks-mix.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-github-issues': minor +--- + +Added ESLint rule `no-top-level-material-ui-4-imports` in the `github-issues` plugin to migrate the Material UI imports. diff --git a/plugins/github-issues/.eslintrc.js b/plugins/github-issues/.eslintrc.js index e2a53a6ad2..9d5b45a010 100644 --- a/plugins/github-issues/.eslintrc.js +++ b/plugins/github-issues/.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/github-issues/src/components/GithubIssues/GithubIssues.tsx b/plugins/github-issues/src/components/GithubIssues/GithubIssues.tsx index faae7fd3a5..e19416aedd 100644 --- a/plugins/github-issues/src/components/GithubIssues/GithubIssues.tsx +++ b/plugins/github-issues/src/components/GithubIssues/GithubIssues.tsx @@ -15,7 +15,9 @@ */ import React from 'react'; -import { Box, IconButton, Typography } from '@material-ui/core'; +import Box from '@material-ui/core/Box'; +import IconButton from '@material-ui/core/IconButton'; +import Typography from '@material-ui/core/Typography'; import { InfoCard, Progress } from '@backstage/core-components'; import RefreshIcon from '@material-ui/icons/Refresh'; import { useEntityGithubRepositories } from '../../hooks/useEntityGithubRepositories'; diff --git a/plugins/github-issues/src/components/GithubIssues/IssueCard/Assignees.tsx b/plugins/github-issues/src/components/GithubIssues/IssueCard/Assignees.tsx index 4b66048039..7a398790de 100644 --- a/plugins/github-issues/src/components/GithubIssues/IssueCard/Assignees.tsx +++ b/plugins/github-issues/src/components/GithubIssues/IssueCard/Assignees.tsx @@ -15,7 +15,10 @@ */ import React from 'react'; -import { Typography, Box, Avatar, makeStyles } from '@material-ui/core'; +import Typography from '@material-ui/core/Typography'; +import Box from '@material-ui/core/Box'; +import Avatar from '@material-ui/core/Avatar'; +import { makeStyles } from '@material-ui/core/styles'; type AssigneesProps = { name?: string; diff --git a/plugins/github-issues/src/components/GithubIssues/IssueCard/CommentsCount.tsx b/plugins/github-issues/src/components/GithubIssues/IssueCard/CommentsCount.tsx index 35352d10d2..cc49a9bf26 100644 --- a/plugins/github-issues/src/components/GithubIssues/IssueCard/CommentsCount.tsx +++ b/plugins/github-issues/src/components/GithubIssues/IssueCard/CommentsCount.tsx @@ -16,7 +16,8 @@ import React from 'react'; import { ChatIcon } from '@backstage/core-components'; -import { Box, Badge } from '@material-ui/core'; +import Box from '@material-ui/core/Box'; +import Badge from '@material-ui/core/Badge'; type CommentsCountProps = { commentsCount: number; diff --git a/plugins/github-issues/src/components/GithubIssues/IssueCard/IssueCard.tsx b/plugins/github-issues/src/components/GithubIssues/IssueCard/IssueCard.tsx index a5a5b79ac0..68b37574ca 100644 --- a/plugins/github-issues/src/components/GithubIssues/IssueCard/IssueCard.tsx +++ b/plugins/github-issues/src/components/GithubIssues/IssueCard/IssueCard.tsx @@ -15,7 +15,10 @@ */ import { Link } from '@backstage/core-components'; -import { Box, CardActionArea, Paper, Typography } from '@material-ui/core'; +import Box from '@material-ui/core/Box'; +import CardActionArea from '@material-ui/core/CardActionArea'; +import Paper from '@material-ui/core/Paper'; +import Typography from '@material-ui/core/Typography'; import Divider from '@material-ui/core/Divider'; import { DateTime } from 'luxon'; import React from 'react'; diff --git a/plugins/github-issues/src/components/GithubIssues/IssuesList/Filters/Filters.tsx b/plugins/github-issues/src/components/GithubIssues/IssuesList/Filters/Filters.tsx index f9e22980db..43dc5fbcb3 100644 --- a/plugins/github-issues/src/components/GithubIssues/IssuesList/Filters/Filters.tsx +++ b/plugins/github-issues/src/components/GithubIssues/IssuesList/Filters/Filters.tsx @@ -16,7 +16,9 @@ import React from 'react'; import { Select, SelectedItems, SelectItem } from '@backstage/core-components'; -import { makeStyles, Box, Typography } from '@material-ui/core'; +import Box from '@material-ui/core/Box'; +import Typography from '@material-ui/core/Typography'; +import { makeStyles } from '@material-ui/core/styles'; type RepositoryFiltersProps = { items: Array; diff --git a/plugins/github-issues/src/components/GithubIssues/IssuesList/IssuesList.tsx b/plugins/github-issues/src/components/GithubIssues/IssuesList/IssuesList.tsx index 0d14e8a7c4..becc584bf9 100644 --- a/plugins/github-issues/src/components/GithubIssues/IssuesList/IssuesList.tsx +++ b/plugins/github-issues/src/components/GithubIssues/IssuesList/IssuesList.tsx @@ -15,8 +15,8 @@ */ import React from 'react'; -import { Box } from '@material-ui/core'; -import { Pagination } from '@material-ui/lab'; +import Box from '@material-ui/core/Box'; +import Pagination from '@material-ui/lab/Pagination'; import { IssueCard } from '../IssueCard'; import { IssuesByRepo } from '../../../api'; import { RepositoryFilters } from './Filters';