From c1160965185df0eae78d08bd73aecd8055105709 Mon Sep 17 00:00:00 2001 From: Gaurav Pandey Date: Thu, 21 Mar 2024 11:50:53 +0530 Subject: [PATCH] chore: added eslint rule for nomad plugin Signed-off-by: Gaurav Pandey --- .changeset/blue-bobcats-nail.md | 5 +++++ plugins/nomad/.eslintrc.js | 6 +++++- .../EntityNomadJobVersionListCard.tsx | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .changeset/blue-bobcats-nail.md diff --git a/.changeset/blue-bobcats-nail.md b/.changeset/blue-bobcats-nail.md new file mode 100644 index 0000000000..9dc27437fb --- /dev/null +++ b/.changeset/blue-bobcats-nail.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-nomad': patch +--- + +Added an optional ESLint rule - no-top-level-material-ui-4-imports -in nomad plugin which has an auto fix function to migrate the imports and used it to migrate the Material UI imports for plugins/nomad. diff --git a/plugins/nomad/.eslintrc.js b/plugins/nomad/.eslintrc.js index e2a53a6ad2..9d5b45a010 100644 --- a/plugins/nomad/.eslintrc.js +++ b/plugins/nomad/.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/nomad/src/components/EntityNomadJobVersionListCard/EntityNomadJobVersionListCard.tsx b/plugins/nomad/src/components/EntityNomadJobVersionListCard/EntityNomadJobVersionListCard.tsx index d7d200bce4..73d44acb3b 100644 --- a/plugins/nomad/src/components/EntityNomadJobVersionListCard/EntityNomadJobVersionListCard.tsx +++ b/plugins/nomad/src/components/EntityNomadJobVersionListCard/EntityNomadJobVersionListCard.tsx @@ -34,7 +34,7 @@ import { isNomadJobIDAvailable, } from '../../annotations'; import OpenInNewIcon from '@material-ui/icons/OpenInNew'; -import { Chip } from '@material-ui/core'; +import Chip from '@material-ui/core/Chip'; type rowType = Version & { nomadAddr: string };