From 004ce717fda61002fabef5c728c5d36305357e9e Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Thu, 21 Mar 2024 11:21:22 +0530 Subject: [PATCH] Add ESLint Rule to OctopusDeploy Plugin Signed-off-by: Aditya Kumar --- .changeset/rare-kiwis-appear.md | 5 +++++ plugins/octopus-deploy/.eslintrc.js | 6 +++++- .../src/components/OctopusDeployIcon/OctopusDeployIcon.tsx | 2 +- .../src/components/ReleaseTable/ReleaseTable.tsx | 3 ++- .../components/ScaffolderDropdown/ProjectGroupDropdown.tsx | 3 ++- 5 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 .changeset/rare-kiwis-appear.md diff --git a/.changeset/rare-kiwis-appear.md b/.changeset/rare-kiwis-appear.md new file mode 100644 index 0000000000..ecc78cb206 --- /dev/null +++ b/.changeset/rare-kiwis-appear.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-octopus-deploy': patch +--- + +Added ESLint rule `no-top-level-material-ui-4-imports` in the `octopus-deploy` plugin to migrate the Material UI imports. diff --git a/plugins/octopus-deploy/.eslintrc.js b/plugins/octopus-deploy/.eslintrc.js index e2a53a6ad2..a2d8179106 100644 --- a/plugins/octopus-deploy/.eslintrc.js +++ b/plugins/octopus-deploy/.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/octopus-deploy/src/components/OctopusDeployIcon/OctopusDeployIcon.tsx b/plugins/octopus-deploy/src/components/OctopusDeployIcon/OctopusDeployIcon.tsx index 626e61ccd8..1fdc974795 100644 --- a/plugins/octopus-deploy/src/components/OctopusDeployIcon/OctopusDeployIcon.tsx +++ b/plugins/octopus-deploy/src/components/OctopusDeployIcon/OctopusDeployIcon.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { SvgIcon, SvgIconProps } from '@material-ui/core'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; import React from 'react'; diff --git a/plugins/octopus-deploy/src/components/ReleaseTable/ReleaseTable.tsx b/plugins/octopus-deploy/src/components/ReleaseTable/ReleaseTable.tsx index b61b533667..6f8dd77b8b 100644 --- a/plugins/octopus-deploy/src/components/ReleaseTable/ReleaseTable.tsx +++ b/plugins/octopus-deploy/src/components/ReleaseTable/ReleaseTable.tsx @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Box, Typography } from '@material-ui/core'; +import Box from '@material-ui/core/Box'; +import Typography from '@material-ui/core/Typography'; import { OctopusEnvironment, OctopusProject, diff --git a/plugins/octopus-deploy/src/components/ScaffolderDropdown/ProjectGroupDropdown.tsx b/plugins/octopus-deploy/src/components/ScaffolderDropdown/ProjectGroupDropdown.tsx index f0ad16b231..b227b56d0b 100644 --- a/plugins/octopus-deploy/src/components/ScaffolderDropdown/ProjectGroupDropdown.tsx +++ b/plugins/octopus-deploy/src/components/ScaffolderDropdown/ProjectGroupDropdown.tsx @@ -15,7 +15,8 @@ */ import React from 'react'; -import { InputLabel, Input } from '@material-ui/core'; +import InputLabel from '@material-ui/core/InputLabel'; +import Input from '@material-ui/core/Input'; import { Select, SelectItem } from '@backstage/core-components'; import { useProjectGroups } from '../../hooks/useProjectGroups'; import { ScaffolderField } from '@backstage/plugin-scaffolder-react/alpha';