@@ -37,13 +37,6 @@ invariant(react.configs.flat, 'For typescript');
37
37
invariant ( react . configs . flat . recommended , 'For typescript' ) ;
38
38
invariant ( react . configs . flat [ 'jsx-runtime' ] , 'For typescript' ) ;
39
39
40
- const restrictedImportPatterns = [
41
- {
42
- group : [ 'sentry/components/devtoolbar/*' ] ,
43
- message : 'Do not depend on toolbar internals' ,
44
- } ,
45
- ] ;
46
-
47
40
const restrictedImportPaths = [
48
41
{
49
42
name : '@testing-library/react' ,
@@ -264,7 +257,23 @@ export default typescript.config([
264
257
'no-proto' : 'error' ,
265
258
'no-restricted-imports' : [
266
259
'error' ,
267
- { patterns : restrictedImportPatterns , paths : restrictedImportPaths } ,
260
+ {
261
+ patterns : [
262
+ {
263
+ group : [ 'admin/*' ] ,
264
+ message : 'Do not import gsAdmin into sentry' ,
265
+ } ,
266
+ {
267
+ group : [ 'getsentry/*' ] ,
268
+ message : 'Do not import gsApp into sentry' ,
269
+ } ,
270
+ {
271
+ group : [ 'sentry/components/devtoolbar/*' ] ,
272
+ message : 'Do not depend on toolbar internals' ,
273
+ } ,
274
+ ] ,
275
+ paths : restrictedImportPaths ,
276
+ } ,
268
277
] ,
269
278
'no-return-assign' : 'error' ,
270
279
'no-script-url' : 'error' ,
@@ -697,6 +706,16 @@ export default typescript.config([
697
706
'no-restricted-imports' : [
698
707
'error' ,
699
708
{
709
+ patterns : [
710
+ {
711
+ group : [ 'admin/*' ] ,
712
+ message : 'Do not import gsAdmin into sentry' ,
713
+ } ,
714
+ {
715
+ group : [ 'getsentry/*' ] ,
716
+ message : 'Do not import gsApp into sentry' ,
717
+ } ,
718
+ ] ,
700
719
paths : [
701
720
...restrictedImportPaths ,
702
721
{
@@ -722,7 +741,20 @@ export default typescript.config([
722
741
'no-restricted-imports' : [
723
742
'error' ,
724
743
{
725
- patterns : restrictedImportPatterns ,
744
+ patterns : [
745
+ {
746
+ group : [ 'admin/*' ] ,
747
+ message : 'Do not import gsAdmin into sentry' ,
748
+ } ,
749
+ {
750
+ group : [ 'getsentry/*' ] ,
751
+ message : 'Do not import gsApp into sentry' ,
752
+ } ,
753
+ {
754
+ group : [ 'sentry/components/devtoolbar/*' ] ,
755
+ message : 'Do not depend on toolbar internals' ,
756
+ } ,
757
+ ] ,
726
758
paths : [
727
759
...restrictedImportPaths ,
728
760
{
@@ -751,4 +783,44 @@ export default typescript.config([
751
783
'no-console' : 'off' ,
752
784
} ,
753
785
} ,
786
+ {
787
+ name : 'files/gsApp' ,
788
+ files : [ 'static/gsApp/**/*.{js,mjs,ts,jsx,tsx}' ] ,
789
+ rules : {
790
+ 'no-restricted-imports' : [
791
+ 'error' ,
792
+ {
793
+ patterns : [
794
+ {
795
+ group : [ 'admin/*' ] ,
796
+ message : 'Do not import gsAdmin into gsApp' ,
797
+ } ,
798
+ {
799
+ group : [ 'sentry/components/devtoolbar/*' ] ,
800
+ message : 'Do not depend on toolbar internals' ,
801
+ } ,
802
+ ] ,
803
+ paths : restrictedImportPaths ,
804
+ } ,
805
+ ] ,
806
+ } ,
807
+ } ,
808
+ {
809
+ name : 'files/gsAdmin' ,
810
+ files : [ 'static/gsAdmin/**/*.{js,mjs,ts,jsx,tsx}' ] ,
811
+ rules : {
812
+ 'no-restricted-imports' : [
813
+ 'error' ,
814
+ {
815
+ patterns : [
816
+ {
817
+ group : [ 'sentry/components/devtoolbar/*' ] ,
818
+ message : 'Do not depend on toolbar internals' ,
819
+ } ,
820
+ ] ,
821
+ paths : restrictedImportPaths ,
822
+ } ,
823
+ ] ,
824
+ } ,
825
+ } ,
754
826
] ) ;
0 commit comments