backstage / backstage

Backstage is an open framework for building developer portals
https://backstage.io/
Apache License 2.0
26.61k stars 5.46k forks source link

core-components: add lint rule to avoid circular imports #24627

Open BethGriggs opened 2 weeks ago

BethGriggs commented 2 weeks ago

Hey, I just made a Pull Request!

Trying to be proactive to avoid issues like https://github.com/backstage/backstage/pull/24511, so figured I'd propose adding a lint rule to packages/core-components. Here's what the lint output would have been:

$ yarn lint
Lint failed in packages/core-components:
✘  http://eslint.org/docs/rules/no-restricted-imports

     '@backstage/core-components' import is restricted from being used.  To avoid circular dependencies, use relative paths to import '@backstage/core-components' from its subdirectories

     src/layout/HeaderTabs/HeaderTabs.tsx:21:1
     19 | import Tabs from '@material-ui/core/Tabs';
     20 | import React, { useCallback, useEffect, useState } from 'react';
   > 21 | import { Link } from '@backstage/core-components';
        | ^
     22 | 
✘ 1 problem (1 error, 0 warnings)

:heavy_check_mark: Checklist

github-actions[bot] commented 2 weeks ago

Uffizzi Ephemeral Environment - Virtual Cluster

Your cluster pr-24627 was successfully created. Learn more about Uffizzi virtual clusters To connect to this cluster, follow these steps:

  1. Download and install the Uffizzi CLI from https://docs.uffizzi.com/install
  2. Login to Uffizzi, then select the backstage account and project:
    uffizzi login
Select an account: 
  ‣ backstage
    jdoe

Select a project or create a new project: 
  ‣ backstage-6783521
  1. Update your kubeconfig: uffizzi cluster update-kubeconfig pr-24627 --kubeconfig=[PATH_TO_KUBECONFIG] After updating your kubeconfig, you can manage your cluster with kubectl, kustomize, helm, and other tools that use kubeconfig files: kubectl get namespace --kubeconfig [PATH_TO_KUBECONFIG]

Access the backstage endpoint at https://backstage-default-pr-24627-c5394.uclusters.app.uffizzi.com