@@ -47,6 +47,14 @@ export default [
4747 name : 'sprotty-protocol' ,
4848 message :
4949 "The sprotty-protocol default exports are customized and reexported by GLSP. Please use '@eclipse-glsp/client' instead"
50+ } ,
51+ {
52+ name : 'uuid' ,
53+ message : "Use the 'generateUuid'/'isUuid' helpers (from '@eclipse-glsp/protocol') instead of importing 'uuid' directly."
54+ } ,
55+ {
56+ name : 'uuid/*' ,
57+ message : "Use the 'generateUuid'/'isUuid' helpers (from '@eclipse-glsp/protocol') instead of importing 'uuid' directly."
5058 }
5159 ] ,
5260 '@typescript-eslint/no-unused-vars' : [
@@ -59,7 +67,7 @@ export default [
5967 ]
6068 }
6169 } ,
62- // packages/protocol: restrict sprotty and circular @eclipse -glsp/client imports
70+ // packages/protocol: restrict sprotty and uuid direct imports
6371 {
6472 files : [ 'packages/protocol/src/**/*.{ts,tsx}' ] ,
6573 rules : {
@@ -75,14 +83,14 @@ export default [
7583 message : "The protocol package should not have any direct 'sprotty' dependencies. Try to use 'sprotty-protocol' instead"
7684 } ,
7785 {
78- name : '@eclipse-glsp/client ' ,
86+ name : 'uuid ' ,
7987 message :
80- "Circular dependency! This package is consumed by '@eclipse-glsp' client. Consider moving the conflicting file into this package ."
88+ "Use the 'generateUuid'/'isUuid' helpers (from this package's 'utils/uuid' module) instead of importing 'uuid' directly ."
8189 } ,
8290 {
83- name : '@eclipse-glsp/client /*' ,
91+ name : 'uuid /*' ,
8492 message :
85- "Circular dependency! This package is consumed by '@eclipse-glsp' client. Consider moving the conflicting file into this package ."
93+ "Use the 'generateUuid'/'isUuid' helpers (from this package's 'utils/uuid' module) instead of importing 'uuid' directly ."
8694 }
8795 ]
8896 }
@@ -101,6 +109,14 @@ export default [
101109 {
102110 name : 'sprotty-protocol/*' ,
103111 message : "Please use '@eclipse-glsp/protocol' instead"
112+ } ,
113+ {
114+ name : 'uuid' ,
115+ message : "Use the 'generateUuid'/'isUuid' helpers (from '@eclipse-glsp/protocol') instead of importing 'uuid' directly."
116+ } ,
117+ {
118+ name : 'uuid/*' ,
119+ message : "Use the 'generateUuid'/'isUuid' helpers (from '@eclipse-glsp/protocol') instead of importing 'uuid' directly."
104120 }
105121 ]
106122 }
@@ -135,6 +151,65 @@ export default [
135151 {
136152 name : '@eclipse-glsp/protocol/*' ,
137153 message : 'Please use @eclipse-glsp/sprotty instead'
154+ } ,
155+ {
156+ name : 'uuid' ,
157+ message : "Use the 'generateUuid'/'isUuid' helpers (from '@eclipse-glsp/sprotty') instead of importing 'uuid' directly."
158+ } ,
159+ {
160+ name : 'uuid/*' ,
161+ message : "Use the 'generateUuid'/'isUuid' helpers (from '@eclipse-glsp/sprotty') instead of importing 'uuid' directly."
162+ }
163+ ]
164+ }
165+ } ,
166+ // examples: only consume the public '@eclipse-glsp/client' API; the lower layers
167+ // (protocol, sprotty, raw sprotty/sprotty-protocol) are re-exported through it.
168+ {
169+ files : [ 'examples/*/src/**/*.{ts,tsx}' ] ,
170+ rules : {
171+ 'no-restricted-imports' : [
172+ 'warn' ,
173+ ...restrictedBaseImports ,
174+ {
175+ name : 'sprotty' ,
176+ message : 'Please use @eclipse-glsp/client instead'
177+ } ,
178+ {
179+ name : 'sprotty/*' ,
180+ message : 'Please use @eclipse-glsp/client instead'
181+ } ,
182+ {
183+ name : 'sprotty-protocol' ,
184+ message : 'Please use @eclipse-glsp/client instead'
185+ } ,
186+ {
187+ name : 'sprotty-protocol/*' ,
188+ message : 'Please use @eclipse-glsp/client instead'
189+ } ,
190+ {
191+ name : '@eclipse-glsp/protocol' ,
192+ message : 'Please use @eclipse-glsp/client instead'
193+ } ,
194+ {
195+ name : '@eclipse-glsp/protocol/*' ,
196+ message : 'Please use @eclipse-glsp/client instead'
197+ } ,
198+ {
199+ name : '@eclipse-glsp/sprotty' ,
200+ message : 'Please use @eclipse-glsp/client instead'
201+ } ,
202+ {
203+ name : '@eclipse-glsp/sprotty/*' ,
204+ message : 'Please use @eclipse-glsp/client instead'
205+ } ,
206+ {
207+ name : 'uuid' ,
208+ message : "Use the 'generateUuid'/'isUuid' helpers (from '@eclipse-glsp/client') instead of importing 'uuid' directly."
209+ } ,
210+ {
211+ name : 'uuid/*' ,
212+ message : "Use the 'generateUuid'/'isUuid' helpers (from '@eclipse-glsp/client') instead of importing 'uuid' directly."
138213 }
139214 ]
140215 }
0 commit comments