|
162 | 162 | } |
163 | 163 | } |
164 | 164 | }, |
| 165 | + { |
| 166 | + "includes": ["packages/core/src/**/*.ts", "packages/core/src/**/*.tsx"], |
| 167 | + "linter": { |
| 168 | + "rules": { |
| 169 | + "style": { |
| 170 | + "noRestrictedImports": { |
| 171 | + "level": "error", |
| 172 | + "options": { |
| 173 | + "patterns": [ |
| 174 | + { |
| 175 | + "group": [ |
| 176 | + "electron", |
| 177 | + "react", |
| 178 | + "react-dom", |
| 179 | + "node:*", |
| 180 | + "@posthog/*" |
| 181 | + ], |
| 182 | + "message": "core is a pure layer that must not depend on any platform-specific dependencies." |
| 183 | + } |
| 184 | + ] |
| 185 | + } |
| 186 | + } |
| 187 | + } |
| 188 | + } |
| 189 | + } |
| 190 | + }, |
| 191 | + { |
| 192 | + "includes": [ |
| 193 | + "packages/api-client/src/**/*.ts", |
| 194 | + "packages/api-client/src/**/*.tsx" |
| 195 | + ], |
| 196 | + "linter": { |
| 197 | + "rules": { |
| 198 | + "style": { |
| 199 | + "noRestrictedImports": { |
| 200 | + "level": "error", |
| 201 | + "options": { |
| 202 | + "patterns": [ |
| 203 | + { |
| 204 | + "group": [ |
| 205 | + "electron", |
| 206 | + "node:*", |
| 207 | + "@posthog/*", |
| 208 | + "!@posthog/core" |
| 209 | + ], |
| 210 | + "message": "api-client must run in any JS environment." |
| 211 | + } |
| 212 | + ] |
| 213 | + } |
| 214 | + } |
| 215 | + } |
| 216 | + } |
| 217 | + } |
| 218 | + }, |
| 219 | + { |
| 220 | + "includes": [ |
| 221 | + "packages/workspace-client/src/**/*.ts", |
| 222 | + "packages/workspace-client/src/**/*.tsx" |
| 223 | + ], |
| 224 | + "linter": { |
| 225 | + "rules": { |
| 226 | + "style": { |
| 227 | + "noRestrictedImports": { |
| 228 | + "level": "error", |
| 229 | + "options": { |
| 230 | + "patterns": [ |
| 231 | + { |
| 232 | + "group": [ |
| 233 | + "electron", |
| 234 | + "node:*", |
| 235 | + "@posthog/*", |
| 236 | + "!@posthog/core", |
| 237 | + "!@posthog/api-client", |
| 238 | + "!@posthog/workspace-server" |
| 239 | + ], |
| 240 | + "message": "workspace-client must run in any JS environment." |
| 241 | + } |
| 242 | + ] |
| 243 | + } |
| 244 | + } |
| 245 | + } |
| 246 | + } |
| 247 | + } |
| 248 | + }, |
| 249 | + { |
| 250 | + "includes": [ |
| 251 | + "packages/platform/src/**/*.ts", |
| 252 | + "packages/platform/src/**/*.tsx" |
| 253 | + ], |
| 254 | + "linter": { |
| 255 | + "rules": { |
| 256 | + "style": { |
| 257 | + "noRestrictedImports": { |
| 258 | + "level": "error", |
| 259 | + "options": { |
| 260 | + "patterns": [ |
| 261 | + { |
| 262 | + "group": [ |
| 263 | + "electron", |
| 264 | + "node:*", |
| 265 | + "@posthog/*", |
| 266 | + "!@posthog/core" |
| 267 | + ], |
| 268 | + "message": "platform is interface-only." |
| 269 | + } |
| 270 | + ] |
| 271 | + } |
| 272 | + } |
| 273 | + } |
| 274 | + } |
| 275 | + } |
| 276 | + }, |
| 277 | + { |
| 278 | + "includes": [ |
| 279 | + "packages/workspace-server/src/**/*.ts", |
| 280 | + "packages/workspace-server/src/**/*.tsx" |
| 281 | + ], |
| 282 | + "linter": { |
| 283 | + "rules": { |
| 284 | + "style": { |
| 285 | + "noRestrictedImports": { |
| 286 | + "level": "error", |
| 287 | + "options": { |
| 288 | + "paths": { |
| 289 | + "electron": "workspace-server must be host-agnostic." |
| 290 | + }, |
| 291 | + "patterns": [ |
| 292 | + { |
| 293 | + "group": ["@posthog/ui", "@posthog/api-client"], |
| 294 | + "message": "workspace-server must not depend on UI or the PostHog API." |
| 295 | + } |
| 296 | + ] |
| 297 | + } |
| 298 | + } |
| 299 | + } |
| 300 | + } |
| 301 | + } |
| 302 | + }, |
| 303 | + { |
| 304 | + "includes": ["packages/ui/src/**/*.ts", "packages/ui/src/**/*.tsx"], |
| 305 | + "linter": { |
| 306 | + "rules": { |
| 307 | + "style": { |
| 308 | + "noRestrictedImports": { |
| 309 | + "level": "error", |
| 310 | + "options": { |
| 311 | + "patterns": [ |
| 312 | + { |
| 313 | + "group": [ |
| 314 | + "electron", |
| 315 | + "node:*", |
| 316 | + "@posthog/*", |
| 317 | + "!@posthog/core", |
| 318 | + "!@posthog/api-client", |
| 319 | + "!@posthog/workspace-client", |
| 320 | + "!@posthog/platform", |
| 321 | + "!@posthog/platform/*" |
| 322 | + ], |
| 323 | + "message": "ui must run in any JS environment." |
| 324 | + } |
| 325 | + ] |
| 326 | + } |
| 327 | + } |
| 328 | + } |
| 329 | + } |
| 330 | + } |
| 331 | + }, |
165 | 332 | { |
166 | 333 | // Renderer code should use path aliases |
167 | 334 | "includes": [ |
|
0 commit comments