cli: prevent imports of stories or tests

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-04-29 10:34:21 +02:00
parent 183948fa85
commit 6cd1f50ae1
2 changed files with 13 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Extended lint rule to prevents imports of stories or tests from production code.
+8 -2
View File
@@ -130,8 +130,14 @@ function createConfig(dir, extraConfig = {}) {
...(restrictedImports ?? []),
...(restrictedSrcImports ?? []),
],
// Avoid cross-package imports
patterns: ['**/../../**/*/src/**', '**/../../**/*/src'],
patterns: [
// Avoid cross-package imports
'**/../../**/*/src/**',
'**/../../**/*/src',
// Prevent imports of stories or tests
'*.stories*',
'*.test*',
],
},
],