Restrict imports on the form ../../plugins/x/src

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2021-09-20 10:28:51 +02:00
parent 86177c5059
commit e9f332a51c
7 changed files with 14 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Restrict imports on the form `../../plugins/x/src`
+4 -1
View File
@@ -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',
+1 -1
View File
@@ -83,7 +83,7 @@ module.exports = {
...require('module').builtinModules,
],
// Avoid cross-package imports
patterns: ['**/../../**/*/src/**'],
patterns: ['**/../../**/*/src/**', '**/../../**/*/src'],
},
],
},
+1
View File
@@ -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"
},
+1 -1
View File
@@ -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 = {
+1 -1
View File
@@ -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';
@@ -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({