You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a file has both a platform suffix in its name AND a `__supportedPlatforms` export, the `__supportedPlatforms` export **takes priority**. This allows you to keep the `.browser.ts` naming convention while expanding support to additional platforms like React Native.
37
+
If a file has both a platform suffix in its name AND a `__platforms` export, the `__platforms` export **takes priority**. This allows you to keep the `.browser.ts` naming convention while expanding support to additional platforms like React Native.
38
38
39
39
## Import Rules
40
40
@@ -51,11 +51,11 @@ A file is compatible if:
51
51
52
52
### Compatibility Examples
53
53
54
-
**Single Platform File (`.browser.ts` or `__supportedPlatforms = ['browser']`)**
54
+
**Single Platform File (`.browser.ts` or `__platforms = ['browser']`)**
55
55
- ✅ Can import from: universal files, `.browser.ts` files, files with `['browser']` or `['browser', 'react_native']`
56
56
- ❌ Cannot import from: `.node.ts` files, files with `['node']` or `['react_native']` only
* // Invalid platform values (must match Platform type definition in platform_support.ts)
14
14
* // Not exported as const array
15
15
*/
@@ -83,15 +83,15 @@ module.exports = {
83
83
meta: {
84
84
type: 'problem',
85
85
docs: {
86
-
description: 'Require __supportedPlatforms export with valid platform values in all source files',
86
+
description: 'Require __platforms export with valid platform values in all source files',
87
87
category: 'Best Practices',
88
88
recommended: true,
89
89
},
90
90
messages: {
91
-
missingPlatformDeclaration: 'File must export __supportedPlatforms to declare which platforms it supports. Example: export const __supportedPlatforms = [\'__universal__\'];',
92
-
invalidPlatformDeclaration: '__supportedPlatforms must be exported as a const array. Example: export const __supportedPlatforms = [\'browser\', \'node\'];',
emptyPlatformArray: '__supportedPlatforms array cannot be empty. Specify at least one platform or use [\'__universal__\']',
91
+
missingPlatformDeclaration: 'File must export __platforms to declare which platforms it supports. Example: export const __platforms = [\'__universal__\'];',
92
+
invalidPlatformDeclaration: '__platforms must be exported as a const array. Example: export const __platforms = [\'browser\', \'node\'];',
0 commit comments