From 2481d8a552077de8f336a9b0cac72b2b4424b520 Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Thu, 14 Mar 2024 13:52:39 +0530 Subject: [PATCH 1/3] Added Material UI 4 import rule to plugins/rollbar Signed-off-by: Aditya Kumar --- .changeset/early-monkeys-drive.md | 5 +++++ plugins/rollbar/.eslintrc.js | 6 +++++- .../RollbarTopItemsTable/RollbarTopItemsTable.tsx | 5 +++-- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .changeset/early-monkeys-drive.md diff --git a/.changeset/early-monkeys-drive.md b/.changeset/early-monkeys-drive.md new file mode 100644 index 0000000000..2d8245f178 --- /dev/null +++ b/.changeset/early-monkeys-drive.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-rollbar': patch +--- + +Added an optional ESLint rule - no-top-level-material-ui-4-imports -in rollbar plugin which has an auto fix function to migrate the imports and used it to migrate the Material UI imports for plugins/rollbar. diff --git a/plugins/rollbar/.eslintrc.js b/plugins/rollbar/.eslintrc.js index e2a53a6ad2..9d5b45a010 100644 --- a/plugins/rollbar/.eslintrc.js +++ b/plugins/rollbar/.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/rollbar/src/components/RollbarTopItemsTable/RollbarTopItemsTable.tsx b/plugins/rollbar/src/components/RollbarTopItemsTable/RollbarTopItemsTable.tsx index 89fa7596b0..c6eb8888ab 100644 --- a/plugins/rollbar/src/components/RollbarTopItemsTable/RollbarTopItemsTable.tsx +++ b/plugins/rollbar/src/components/RollbarTopItemsTable/RollbarTopItemsTable.tsx @@ -14,8 +14,9 @@ * limitations under the License. */ -import { Box, Typography } from '@material-ui/core'; -import { Alert } from '@material-ui/lab'; +import Box from '@material-ui/core/Box'; +import Typography from '@material-ui/core/Typography'; +import Alert from '@material-ui/lab/Alert'; import React from 'react'; import { RollbarFrameworkId, From 71e5ee60425408cd7bed0c605df94f8907411a2a Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Thu, 14 Mar 2024 16:58:54 +0530 Subject: [PATCH 2/3] Added Material UI 4 import rule to plugins/rollbar Signed-off-by: Aditya Kumar --- .changeset/early-monkeys-drive.md | 2 +- plugins/rollbar/.eslintrc.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.changeset/early-monkeys-drive.md b/.changeset/early-monkeys-drive.md index 2d8245f178..ffb7157d27 100644 --- a/.changeset/early-monkeys-drive.md +++ b/.changeset/early-monkeys-drive.md @@ -2,4 +2,4 @@ '@backstage/plugin-rollbar': patch --- -Added an optional ESLint rule - no-top-level-material-ui-4-imports -in rollbar plugin which has an auto fix function to migrate the imports and used it to migrate the Material UI imports for plugins/rollbar. +Adjusted MUI imports for better tree shaking. diff --git a/plugins/rollbar/.eslintrc.js b/plugins/rollbar/.eslintrc.js index 9d5b45a010..d801c159a0 100644 --- a/plugins/rollbar/.eslintrc.js +++ b/plugins/rollbar/.eslintrc.js @@ -1,5 +1,5 @@ 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 + rules: { + '@backstage/no-top-level-material-ui-4-imports': 'error', + }, +}); \ No newline at end of file From 7e84e2db88ada916549cb63950d8fd39a924ae7a Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Thu, 14 Mar 2024 17:22:34 +0530 Subject: [PATCH 3/3] Added Material UI 4 import rule to plugins/rollbar Signed-off-by: Aditya Kumar --- plugins/rollbar/.eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rollbar/.eslintrc.js b/plugins/rollbar/.eslintrc.js index d801c159a0..e487f765b2 100644 --- a/plugins/rollbar/.eslintrc.js +++ b/plugins/rollbar/.eslintrc.js @@ -2,4 +2,4 @@ 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 +});