From 813f99dcf65322c8a9c7adc5eb0c0f9e6fbb27dc Mon Sep 17 00:00:00 2001 From: AmbrishRamachandiran Date: Thu, 21 Mar 2024 18:38:41 +0530 Subject: [PATCH] Add ESLint Rule to graphql-voyager Plugin Signed-off-by: AmbrishRamachandiran --- .changeset/new-bulldogs-smoke.md | 5 +++++ plugins/graphql-voyager/.eslintrc.js | 6 +++++- .../GraphQLVoyagerBrowser/GraphQLVoyagerBrowser.tsx | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .changeset/new-bulldogs-smoke.md diff --git a/.changeset/new-bulldogs-smoke.md b/.changeset/new-bulldogs-smoke.md new file mode 100644 index 0000000000..0013bebe66 --- /dev/null +++ b/.changeset/new-bulldogs-smoke.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-graphql-voyager': patch +--- + +Added ESLint rule `no-top-level-material-ui-4-imports` in the `graphql-voyager` plugin to migrate the Material UI imports. diff --git a/plugins/graphql-voyager/.eslintrc.js b/plugins/graphql-voyager/.eslintrc.js index e2a53a6ad2..c69a8f6aff 100644 --- a/plugins/graphql-voyager/.eslintrc.js +++ b/plugins/graphql-voyager/.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/graphql-voyager/src/components/GraphQLVoyagerBrowser/GraphQLVoyagerBrowser.tsx b/plugins/graphql-voyager/src/components/GraphQLVoyagerBrowser/GraphQLVoyagerBrowser.tsx index 21e73498f3..14ef19ec58 100644 --- a/plugins/graphql-voyager/src/components/GraphQLVoyagerBrowser/GraphQLVoyagerBrowser.tsx +++ b/plugins/graphql-voyager/src/components/GraphQLVoyagerBrowser/GraphQLVoyagerBrowser.tsx @@ -19,7 +19,10 @@ import { introspectionQuery, } from '../../lib/api/types'; import { useState } from 'react'; -import { makeStyles, Tab, Tabs, Typography } from '@material-ui/core'; +import Tab from '@material-ui/core/Tab'; +import Tabs from '@material-ui/core/Tabs'; +import Typography from '@material-ui/core/Typography'; +import { makeStyles } from '@material-ui/core/styles'; import React, { Suspense } from 'react'; import { Content, ErrorPanel, Progress } from '@backstage/core-components'; import { Voyager } from 'graphql-voyager';