diff --git a/.changeset/slow-starfishes-retire.md b/.changeset/slow-starfishes-retire.md new file mode 100644 index 0000000000..35fc64fa8b --- /dev/null +++ b/.changeset/slow-starfishes-retire.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Restrict imports on the form `../../plugins/x/src` diff --git a/packages/cli/config/eslint.backend.js b/packages/cli/config/eslint.backend.js index c619df9eee..99767f5d79 100644 --- a/packages/cli/config/eslint.backend.js +++ b/packages/cli/config/eslint.backend.js @@ -62,7 +62,10 @@ module.exports = { { vars: 'all', args: 'after-used', ignoreRestSiblings: true }, ], // Avoid cross-package imports - 'no-restricted-imports': [2, { patterns: ['**/../../**/*/src/**'] }], + 'no-restricted-imports': [ + 2, + { patterns: ['**/../../**/*/src/**', '**/../../**/*/src'] }, + ], // Avoid default import from winston as it breaks at runtime 'no-restricted-syntax': [ 'error', diff --git a/packages/cli/config/eslint.js b/packages/cli/config/eslint.js index b8d3d98c8f..2a85c307b0 100644 --- a/packages/cli/config/eslint.js +++ b/packages/cli/config/eslint.js @@ -83,7 +83,7 @@ module.exports = { ...require('module').builtinModules, ], // Avoid cross-package imports - patterns: ['**/../../**/*/src/**'], + patterns: ['**/../../**/*/src/**', '**/../../**/*/src'], }, ], }, diff --git a/packages/config/package.json b/packages/config/package.json index 13b074c620..d165ceb6f6 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -33,6 +33,7 @@ "lodash": "^4.17.21" }, "devDependencies": { + "@backstage/test-utils-core": "^0.1.2", "@types/jest": "^26.0.7", "@types/node": "^14.14.32" }, diff --git a/packages/config/src/reader.test.ts b/packages/config/src/reader.test.ts index 7f3513abf6..0cea80dca1 100644 --- a/packages/config/src/reader.test.ts +++ b/packages/config/src/reader.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { withLogCollector } from '../../test-utils-core/src'; +import { withLogCollector } from '@backstage/test-utils-core'; import { ConfigReader } from './reader'; const DATA = { diff --git a/packages/core-components/api-report.md b/packages/core-components/api-report.md index e987d6b67e..b5c98add13 100644 --- a/packages/core-components/api-report.md +++ b/packages/core-components/api-report.md @@ -7,6 +7,7 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstageIdentityApi } from '@backstage/core-plugin-api'; +import { BackstageTheme } from '@backstage/theme'; import { Breadcrumbs as Breadcrumbs_2 } from '@material-ui/core'; import { ButtonProps } from '@material-ui/core'; import { CardHeaderProps } from '@material-ui/core'; @@ -25,7 +26,6 @@ import { LinkProps as LinkProps_2 } from '@material-ui/core'; import { LinkProps as LinkProps_3 } from 'react-router-dom'; import { MaterialTableProps } from '@material-table/core'; import { NavLinkProps } from 'react-router-dom'; -import { Palette } from '@material-ui/core/styles/createPalette'; import { ProfileInfoApi } from '@backstage/core-plugin-api'; import { PropsWithChildren } from 'react'; import PropTypes from 'prop-types'; diff --git a/packages/core-components/src/layout/ItemCard/ItemCardHeader.tsx b/packages/core-components/src/layout/ItemCard/ItemCardHeader.tsx index 15a1a7d78b..4dbc5d7c1a 100644 --- a/packages/core-components/src/layout/ItemCard/ItemCardHeader.tsx +++ b/packages/core-components/src/layout/ItemCard/ItemCardHeader.tsx @@ -21,7 +21,7 @@ import { WithStyles, } from '@material-ui/core'; import React from 'react'; -import { BackstageTheme } from '../../../../theme/src'; +import { BackstageTheme } from '@backstage/theme'; const styles = (theme: BackstageTheme) => createStyles({