@atlaskit/eslint-plugin-platform 2.9.1 → 2.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,31 @@
1
+ import type { Rule } from 'eslint';
2
+ /**
3
+ * Disallows passing xcss() results into cx() when used in an xcss prop.
4
+ *
5
+ * xcss() from @atlaskit/primitives and cx() from @atlaskit/css / @compiled/react
6
+ * are incompatible — xcss() produces an opaque StyleRule object, while cx()
7
+ * expects Compiled atomic class name strings. Mixing them causes runtime errors.
8
+ * xcss() results must never be passed to cx(), whether inline or pre-defined.
9
+ *
10
+ * ❌ Wrong — xcss() called inline inside cx():
11
+ * xcss={cx(xcss({ color: 'red' }), xcss({ fontWeight: 'bold' }))}
12
+ *
13
+ * ❌ Also wrong — xcss() results pre-defined but still passed into cx():
14
+ * const baseStyles = xcss({ color: 'red' });
15
+ * const boldStyles = xcss({ fontWeight: 'bold' });
16
+ * xcss={cx(baseStyles, boldStyles)}
17
+ *
18
+ * ✅ Correct — pass xcss() results directly to the xcss prop (no cx()):
19
+ * const baseStyles = xcss({ color: 'red' });
20
+ * xcss={baseStyles}
21
+ *
22
+ * ✅ Correct — use cssMap() + cx() (cssMap is compatible with cx()):
23
+ * const styles = cssMap({ base: { color: 'red' } });
24
+ * xcss={cx(styles.base, condition && styles.focused)}
25
+ *
26
+ * This rule is import-aware: it only flags xcss() calls (inline or via variable)
27
+ * imported from @atlaskit/primitives inside cx() calls imported from @atlaskit/css
28
+ * or @compiled/react that appear inside an xcss prop.
29
+ */
30
+ declare const rule: Rule.RuleModule;
31
+ export default rule;
@@ -1,42 +1,44 @@
1
- import type { ESLint, Linter } from 'eslint';
1
+ import type { ESLint, Linter, Rule } from 'eslint';
2
2
  declare const rules: {
3
- 'ensure-feature-flag-registration': import("eslint").Rule.RuleModule;
4
- 'ensure-test-runner-arguments': import("eslint").Rule.RuleModule;
5
- 'ensure-test-runner-nested-count': import("eslint").Rule.RuleModule;
6
- 'ensure-atlassian-team': import("eslint").Rule.RuleModule;
7
- 'ensure-critical-dependency-resolutions': import("eslint").Rule.RuleModule;
8
- 'ensure-valid-bin-values': import("eslint").Rule.RuleModule;
9
- 'ensure-no-private-dependencies': import("eslint").Rule.RuleModule;
10
- 'expand-border-shorthand': import("eslint").Rule.RuleModule;
11
- 'expand-background-shorthand': import("eslint").Rule.RuleModule;
12
- 'expand-spacing-shorthand': import("eslint").Rule.RuleModule;
13
- 'no-duplicate-dependencies': import("eslint").Rule.RuleModule;
14
- 'no-invalid-feature-flag-usage': import("eslint").Rule.RuleModule;
15
- 'no-pre-post-install-scripts': import("eslint").Rule.RuleModule;
16
- 'no-invalid-storybook-decorator-usage': import("eslint").Rule.RuleModule;
17
- 'ensure-publish-valid': import("eslint").Rule.RuleModule;
18
- 'no-module-level-eval': import("eslint").Rule.RuleModule;
19
- 'no-module-level-eval-nav4': import("eslint").Rule.RuleModule;
20
- 'static-feature-flags': import("eslint").Rule.RuleModule;
21
- 'no-preconditioning': import("eslint").Rule.RuleModule;
22
- 'inline-usage': import("eslint").Rule.RuleModule;
23
- 'prefer-fg': import("eslint").Rule.RuleModule;
24
- 'no-alias': import("eslint").Rule.RuleModule;
25
- 'use-entrypoints-in-examples': import("eslint").Rule.RuleModule;
26
- 'use-recommended-utils': import("eslint").Rule.RuleModule;
27
- 'valid-gate-name': import("eslint").Rule.RuleModule;
28
- 'no-sparse-checkout': import("eslint").Rule.RuleModule;
29
- 'no-direct-document-usage': import("eslint").Rule.RuleModule;
30
- 'no-set-immediate': import("eslint").Rule.RuleModule;
31
- 'prefer-crypto-random-uuid': import("eslint").Rule.RuleModule;
32
- 'no-restricted-fedramp-imports': import("eslint").Rule.RuleModule;
33
- 'no-barrel-entry-imports': import("eslint").Rule.RuleModule;
34
- 'no-barrel-entry-jest-mock': import("eslint").Rule.RuleModule;
35
- 'no-jest-mock-barrel-files': import("eslint").Rule.RuleModule;
36
- 'no-relative-barrel-file-imports': import("eslint").Rule.RuleModule;
37
- 'no-conversation-assistant-barrel-imports': import("eslint").Rule.RuleModule;
38
- 'visit-example-type-import-required': import("eslint").Rule.RuleModule;
39
- 'ensure-use-sync-external-store-server-snapshot': import("eslint").Rule.RuleModule;
3
+ 'ensure-feature-flag-registration': Rule.RuleModule;
4
+ 'ensure-test-runner-arguments': Rule.RuleModule;
5
+ 'ensure-test-runner-nested-count': Rule.RuleModule;
6
+ 'ensure-atlassian-team': Rule.RuleModule;
7
+ 'ensure-critical-dependency-resolutions': Rule.RuleModule;
8
+ 'ensure-valid-bin-values': Rule.RuleModule;
9
+ 'ensure-no-private-dependencies': Rule.RuleModule;
10
+ 'expand-border-shorthand': Rule.RuleModule;
11
+ 'expand-background-shorthand': Rule.RuleModule;
12
+ 'expand-spacing-shorthand': Rule.RuleModule;
13
+ 'no-css-prop-in-object-spread': Rule.RuleModule;
14
+ 'no-duplicate-dependencies': Rule.RuleModule;
15
+ 'no-invalid-feature-flag-usage': Rule.RuleModule;
16
+ 'no-pre-post-install-scripts': Rule.RuleModule;
17
+ 'no-invalid-storybook-decorator-usage': Rule.RuleModule;
18
+ 'ensure-publish-valid': Rule.RuleModule;
19
+ 'no-module-level-eval': Rule.RuleModule;
20
+ 'no-module-level-eval-nav4': Rule.RuleModule;
21
+ 'static-feature-flags': Rule.RuleModule;
22
+ 'no-preconditioning': Rule.RuleModule;
23
+ 'inline-usage': Rule.RuleModule;
24
+ 'prefer-fg': Rule.RuleModule;
25
+ 'no-alias': Rule.RuleModule;
26
+ 'use-entrypoints-in-examples': Rule.RuleModule;
27
+ 'use-recommended-utils': Rule.RuleModule;
28
+ 'valid-gate-name': Rule.RuleModule;
29
+ 'no-sparse-checkout': Rule.RuleModule;
30
+ 'no-direct-document-usage': Rule.RuleModule;
31
+ 'no-set-immediate': Rule.RuleModule;
32
+ 'prefer-crypto-random-uuid': Rule.RuleModule;
33
+ 'no-restricted-fedramp-imports': Rule.RuleModule;
34
+ 'no-barrel-entry-imports': Rule.RuleModule;
35
+ 'no-barrel-entry-jest-mock': Rule.RuleModule;
36
+ 'no-jest-mock-barrel-files': Rule.RuleModule;
37
+ 'no-relative-barrel-file-imports': Rule.RuleModule;
38
+ 'no-conversation-assistant-barrel-imports': Rule.RuleModule;
39
+ 'visit-example-type-import-required': Rule.RuleModule;
40
+ 'no-xcss-in-cx': Rule.RuleModule;
41
+ 'ensure-use-sync-external-store-server-snapshot': Rule.RuleModule;
40
42
  };
41
43
  declare const plugin: {
42
44
  meta: {
@@ -44,70 +46,72 @@ declare const plugin: {
44
46
  version: string;
45
47
  };
46
48
  rules: {
47
- 'ensure-feature-flag-registration': import("eslint").Rule.RuleModule;
48
- 'ensure-test-runner-arguments': import("eslint").Rule.RuleModule;
49
- 'ensure-test-runner-nested-count': import("eslint").Rule.RuleModule;
50
- 'ensure-atlassian-team': import("eslint").Rule.RuleModule;
51
- 'ensure-critical-dependency-resolutions': import("eslint").Rule.RuleModule;
52
- 'ensure-valid-bin-values': import("eslint").Rule.RuleModule;
53
- 'ensure-no-private-dependencies': import("eslint").Rule.RuleModule;
54
- 'expand-border-shorthand': import("eslint").Rule.RuleModule;
55
- 'expand-background-shorthand': import("eslint").Rule.RuleModule;
56
- 'expand-spacing-shorthand': import("eslint").Rule.RuleModule;
57
- 'no-duplicate-dependencies': import("eslint").Rule.RuleModule;
58
- 'no-invalid-feature-flag-usage': import("eslint").Rule.RuleModule;
59
- 'no-pre-post-install-scripts': import("eslint").Rule.RuleModule;
60
- 'no-invalid-storybook-decorator-usage': import("eslint").Rule.RuleModule;
61
- 'ensure-publish-valid': import("eslint").Rule.RuleModule;
62
- 'no-module-level-eval': import("eslint").Rule.RuleModule;
63
- 'no-module-level-eval-nav4': import("eslint").Rule.RuleModule;
64
- 'static-feature-flags': import("eslint").Rule.RuleModule;
65
- 'no-preconditioning': import("eslint").Rule.RuleModule;
66
- 'inline-usage': import("eslint").Rule.RuleModule;
67
- 'prefer-fg': import("eslint").Rule.RuleModule;
68
- 'no-alias': import("eslint").Rule.RuleModule;
69
- 'use-entrypoints-in-examples': import("eslint").Rule.RuleModule;
70
- 'use-recommended-utils': import("eslint").Rule.RuleModule;
71
- 'valid-gate-name': import("eslint").Rule.RuleModule;
72
- 'no-sparse-checkout': import("eslint").Rule.RuleModule;
73
- 'no-direct-document-usage': import("eslint").Rule.RuleModule;
74
- 'no-set-immediate': import("eslint").Rule.RuleModule;
75
- 'prefer-crypto-random-uuid': import("eslint").Rule.RuleModule;
76
- 'no-restricted-fedramp-imports': import("eslint").Rule.RuleModule;
77
- 'no-barrel-entry-imports': import("eslint").Rule.RuleModule;
78
- 'no-barrel-entry-jest-mock': import("eslint").Rule.RuleModule;
79
- 'no-jest-mock-barrel-files': import("eslint").Rule.RuleModule;
80
- 'no-relative-barrel-file-imports': import("eslint").Rule.RuleModule;
81
- 'no-conversation-assistant-barrel-imports': import("eslint").Rule.RuleModule;
82
- 'visit-example-type-import-required': import("eslint").Rule.RuleModule;
83
- 'ensure-use-sync-external-store-server-snapshot': import("eslint").Rule.RuleModule;
49
+ 'ensure-feature-flag-registration': Rule.RuleModule;
50
+ 'ensure-test-runner-arguments': Rule.RuleModule;
51
+ 'ensure-test-runner-nested-count': Rule.RuleModule;
52
+ 'ensure-atlassian-team': Rule.RuleModule;
53
+ 'ensure-critical-dependency-resolutions': Rule.RuleModule;
54
+ 'ensure-valid-bin-values': Rule.RuleModule;
55
+ 'ensure-no-private-dependencies': Rule.RuleModule;
56
+ 'expand-border-shorthand': Rule.RuleModule;
57
+ 'expand-background-shorthand': Rule.RuleModule;
58
+ 'expand-spacing-shorthand': Rule.RuleModule;
59
+ 'no-css-prop-in-object-spread': Rule.RuleModule;
60
+ 'no-duplicate-dependencies': Rule.RuleModule;
61
+ 'no-invalid-feature-flag-usage': Rule.RuleModule;
62
+ 'no-pre-post-install-scripts': Rule.RuleModule;
63
+ 'no-invalid-storybook-decorator-usage': Rule.RuleModule;
64
+ 'ensure-publish-valid': Rule.RuleModule;
65
+ 'no-module-level-eval': Rule.RuleModule;
66
+ 'no-module-level-eval-nav4': Rule.RuleModule;
67
+ 'static-feature-flags': Rule.RuleModule;
68
+ 'no-preconditioning': Rule.RuleModule;
69
+ 'inline-usage': Rule.RuleModule;
70
+ 'prefer-fg': Rule.RuleModule;
71
+ 'no-alias': Rule.RuleModule;
72
+ 'use-entrypoints-in-examples': Rule.RuleModule;
73
+ 'use-recommended-utils': Rule.RuleModule;
74
+ 'valid-gate-name': Rule.RuleModule;
75
+ 'no-sparse-checkout': Rule.RuleModule;
76
+ 'no-direct-document-usage': Rule.RuleModule;
77
+ 'no-set-immediate': Rule.RuleModule;
78
+ 'prefer-crypto-random-uuid': Rule.RuleModule;
79
+ 'no-restricted-fedramp-imports': Rule.RuleModule;
80
+ 'no-barrel-entry-imports': Rule.RuleModule;
81
+ 'no-barrel-entry-jest-mock': Rule.RuleModule;
82
+ 'no-jest-mock-barrel-files': Rule.RuleModule;
83
+ 'no-relative-barrel-file-imports': Rule.RuleModule;
84
+ 'no-conversation-assistant-barrel-imports': Rule.RuleModule;
85
+ 'visit-example-type-import-required': Rule.RuleModule;
86
+ 'ensure-use-sync-external-store-server-snapshot': Rule.RuleModule;
84
87
  };
85
88
  configs: {
86
89
  recommended: {
87
90
  plugins: string[];
88
91
  rules: {
89
- '@atlaskit/platform/no-module-level-eval': "error";
90
- '@atlaskit/platform/static-feature-flags': "error";
91
- '@atlaskit/platform/no-preconditioning': "error";
92
- '@atlaskit/platform/inline-usage': "error";
93
- '@atlaskit/platform/prefer-fg': "error";
94
- '@atlaskit/platform/no-alias': "error";
95
- '@atlaskit/platform/valid-gate-name': "error";
96
- '@atlaskit/platform/ensure-feature-flag-registration': "error";
97
- '@atlaskit/platform/ensure-test-runner-arguments': "error";
98
- '@atlaskit/platform/ensure-test-runner-nested-count': "warn";
99
- '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': "error";
100
- '@atlaskit/platform/no-invalid-feature-flag-usage': "error";
101
- '@atlaskit/platform/no-invalid-storybook-decorator-usage': "error";
102
- '@atlaskit/platform/ensure-atlassian-team': "error";
103
- '@atlaskit/platform/no-module-level-eval-nav4': "error";
104
- '@atlaskit/platform/no-direct-document-usage': "warn";
105
- '@atlaskit/platform/no-set-immediate': "error";
106
- '@atlaskit/platform/expand-border-shorthand': "error";
107
- '@atlaskit/platform/expand-background-shorthand': "error";
108
- '@atlaskit/platform/expand-spacing-shorthand': "error";
92
+ '@atlaskit/platform/no-module-level-eval': 'error';
93
+ '@atlaskit/platform/static-feature-flags': 'error';
94
+ '@atlaskit/platform/no-preconditioning': 'error';
95
+ '@atlaskit/platform/inline-usage': 'error';
96
+ '@atlaskit/platform/prefer-fg': 'error';
97
+ '@atlaskit/platform/no-alias': 'error';
98
+ '@atlaskit/platform/valid-gate-name': 'error';
99
+ '@atlaskit/platform/ensure-feature-flag-registration': 'error';
100
+ '@atlaskit/platform/ensure-test-runner-arguments': 'error';
101
+ '@atlaskit/platform/ensure-test-runner-nested-count': 'warn';
102
+ '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': 'error';
103
+ '@atlaskit/platform/no-invalid-feature-flag-usage': 'error';
104
+ '@atlaskit/platform/no-invalid-storybook-decorator-usage': 'error';
105
+ '@atlaskit/platform/ensure-atlassian-team': 'error';
106
+ '@atlaskit/platform/no-module-level-eval-nav4': 'error';
107
+ '@atlaskit/platform/no-direct-document-usage': 'warn';
108
+ '@atlaskit/platform/no-set-immediate': 'error';
109
+ '@atlaskit/platform/expand-border-shorthand': 'error';
110
+ '@atlaskit/platform/expand-background-shorthand': 'error';
111
+ '@atlaskit/platform/expand-spacing-shorthand': 'error';
112
+ '@atlaskit/platform/no-css-prop-in-object-spread': 'error';
109
113
  '@compiled/jsx-pragma': [
110
- "error",
114
+ 'error',
111
115
  {
112
116
  importSources: string[];
113
117
  onlyRunIfImportingCompiled: boolean;
@@ -122,28 +126,29 @@ declare const plugin: {
122
126
  '@compiled': ESLint.Plugin;
123
127
  };
124
128
  rules: {
125
- '@atlaskit/platform/no-module-level-eval': "error";
126
- '@atlaskit/platform/static-feature-flags': "error";
127
- '@atlaskit/platform/no-preconditioning': "error";
128
- '@atlaskit/platform/inline-usage': "error";
129
- '@atlaskit/platform/prefer-fg': "error";
130
- '@atlaskit/platform/no-alias': "error";
131
- '@atlaskit/platform/valid-gate-name': "error";
132
- '@atlaskit/platform/ensure-feature-flag-registration': "error";
133
- '@atlaskit/platform/ensure-test-runner-arguments': "error";
134
- '@atlaskit/platform/ensure-test-runner-nested-count': "warn";
135
- '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': "error";
136
- '@atlaskit/platform/no-invalid-feature-flag-usage': "error";
137
- '@atlaskit/platform/no-invalid-storybook-decorator-usage': "error";
138
- '@atlaskit/platform/ensure-atlassian-team': "error";
139
- '@atlaskit/platform/no-module-level-eval-nav4': "error";
140
- '@atlaskit/platform/no-direct-document-usage': "warn";
141
- '@atlaskit/platform/no-set-immediate': "error";
142
- '@atlaskit/platform/expand-border-shorthand': "error";
143
- '@atlaskit/platform/expand-background-shorthand': "error";
144
- '@atlaskit/platform/expand-spacing-shorthand': "error";
129
+ '@atlaskit/platform/no-module-level-eval': 'error';
130
+ '@atlaskit/platform/static-feature-flags': 'error';
131
+ '@atlaskit/platform/no-preconditioning': 'error';
132
+ '@atlaskit/platform/inline-usage': 'error';
133
+ '@atlaskit/platform/prefer-fg': 'error';
134
+ '@atlaskit/platform/no-alias': 'error';
135
+ '@atlaskit/platform/valid-gate-name': 'error';
136
+ '@atlaskit/platform/ensure-feature-flag-registration': 'error';
137
+ '@atlaskit/platform/ensure-test-runner-arguments': 'error';
138
+ '@atlaskit/platform/ensure-test-runner-nested-count': 'warn';
139
+ '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': 'error';
140
+ '@atlaskit/platform/no-invalid-feature-flag-usage': 'error';
141
+ '@atlaskit/platform/no-invalid-storybook-decorator-usage': 'error';
142
+ '@atlaskit/platform/ensure-atlassian-team': 'error';
143
+ '@atlaskit/platform/no-module-level-eval-nav4': 'error';
144
+ '@atlaskit/platform/no-direct-document-usage': 'warn';
145
+ '@atlaskit/platform/no-set-immediate': 'error';
146
+ '@atlaskit/platform/expand-border-shorthand': 'error';
147
+ '@atlaskit/platform/expand-background-shorthand': 'error';
148
+ '@atlaskit/platform/expand-spacing-shorthand': 'error';
149
+ '@atlaskit/platform/no-css-prop-in-object-spread': 'error';
145
150
  '@compiled/jsx-pragma': [
146
- "error",
151
+ 'error',
147
152
  {
148
153
  importSources: string[];
149
154
  onlyRunIfImportingCompiled: boolean;
@@ -155,20 +160,21 @@ declare const plugin: {
155
160
  jira: {
156
161
  plugins: string[];
157
162
  rules: {
158
- '@atlaskit/platform/ensure-test-runner-arguments': "error";
159
- '@atlaskit/platform/ensure-test-runner-nested-count': "warn";
160
- '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': "error";
161
- '@atlaskit/platform/no-invalid-feature-flag-usage': "error";
162
- '@atlaskit/platform/no-invalid-storybook-decorator-usage': "error";
163
- '@atlaskit/platform/ensure-atlassian-team': "error";
164
- '@atlaskit/platform/no-module-level-eval-nav4': "error";
165
- '@atlaskit/platform/no-direct-document-usage': "warn";
166
- '@atlaskit/platform/no-set-immediate': "error";
167
- '@atlaskit/platform/expand-border-shorthand': "error";
168
- '@atlaskit/platform/expand-background-shorthand': "error";
169
- '@atlaskit/platform/expand-spacing-shorthand': "error";
163
+ '@atlaskit/platform/ensure-test-runner-arguments': 'error';
164
+ '@atlaskit/platform/ensure-test-runner-nested-count': 'warn';
165
+ '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': 'error';
166
+ '@atlaskit/platform/no-invalid-feature-flag-usage': 'error';
167
+ '@atlaskit/platform/no-invalid-storybook-decorator-usage': 'error';
168
+ '@atlaskit/platform/ensure-atlassian-team': 'error';
169
+ '@atlaskit/platform/no-module-level-eval-nav4': 'error';
170
+ '@atlaskit/platform/no-direct-document-usage': 'warn';
171
+ '@atlaskit/platform/no-set-immediate': 'error';
172
+ '@atlaskit/platform/expand-border-shorthand': 'error';
173
+ '@atlaskit/platform/expand-background-shorthand': 'error';
174
+ '@atlaskit/platform/expand-spacing-shorthand': 'error';
175
+ '@atlaskit/platform/no-css-prop-in-object-spread': 'error';
170
176
  '@compiled/jsx-pragma': [
171
- "error",
177
+ 'error',
172
178
  {
173
179
  importSources: string[];
174
180
  onlyRunIfImportingCompiled: boolean;
@@ -183,20 +189,21 @@ declare const plugin: {
183
189
  '@compiled': ESLint.Plugin;
184
190
  };
185
191
  rules: {
186
- '@atlaskit/platform/ensure-test-runner-arguments': "error";
187
- '@atlaskit/platform/ensure-test-runner-nested-count': "warn";
188
- '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': "error";
189
- '@atlaskit/platform/no-invalid-feature-flag-usage': "error";
190
- '@atlaskit/platform/no-invalid-storybook-decorator-usage': "error";
191
- '@atlaskit/platform/ensure-atlassian-team': "error";
192
- '@atlaskit/platform/no-module-level-eval-nav4': "error";
193
- '@atlaskit/platform/no-direct-document-usage': "warn";
194
- '@atlaskit/platform/no-set-immediate': "error";
195
- '@atlaskit/platform/expand-border-shorthand': "error";
196
- '@atlaskit/platform/expand-background-shorthand': "error";
197
- '@atlaskit/platform/expand-spacing-shorthand': "error";
192
+ '@atlaskit/platform/ensure-test-runner-arguments': 'error';
193
+ '@atlaskit/platform/ensure-test-runner-nested-count': 'warn';
194
+ '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': 'error';
195
+ '@atlaskit/platform/no-invalid-feature-flag-usage': 'error';
196
+ '@atlaskit/platform/no-invalid-storybook-decorator-usage': 'error';
197
+ '@atlaskit/platform/ensure-atlassian-team': 'error';
198
+ '@atlaskit/platform/no-module-level-eval-nav4': 'error';
199
+ '@atlaskit/platform/no-direct-document-usage': 'warn';
200
+ '@atlaskit/platform/no-set-immediate': 'error';
201
+ '@atlaskit/platform/expand-border-shorthand': 'error';
202
+ '@atlaskit/platform/expand-background-shorthand': 'error';
203
+ '@atlaskit/platform/expand-spacing-shorthand': 'error';
204
+ '@atlaskit/platform/no-css-prop-in-object-spread': 'error';
198
205
  '@compiled/jsx-pragma': [
199
- "error",
206
+ 'error',
200
207
  {
201
208
  importSources: string[];
202
209
  onlyRunIfImportingCompiled: boolean;
@@ -215,28 +222,29 @@ declare const configs: {
215
222
  recommended: {
216
223
  plugins: string[];
217
224
  rules: {
218
- '@atlaskit/platform/no-module-level-eval': "error";
219
- '@atlaskit/platform/static-feature-flags': "error";
220
- '@atlaskit/platform/no-preconditioning': "error";
221
- '@atlaskit/platform/inline-usage': "error";
222
- '@atlaskit/platform/prefer-fg': "error";
223
- '@atlaskit/platform/no-alias': "error";
224
- '@atlaskit/platform/valid-gate-name': "error";
225
- '@atlaskit/platform/ensure-feature-flag-registration': "error";
226
- '@atlaskit/platform/ensure-test-runner-arguments': "error";
227
- '@atlaskit/platform/ensure-test-runner-nested-count': "warn";
228
- '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': "error";
229
- '@atlaskit/platform/no-invalid-feature-flag-usage': "error";
230
- '@atlaskit/platform/no-invalid-storybook-decorator-usage': "error";
231
- '@atlaskit/platform/ensure-atlassian-team': "error";
232
- '@atlaskit/platform/no-module-level-eval-nav4': "error";
233
- '@atlaskit/platform/no-direct-document-usage': "warn";
234
- '@atlaskit/platform/no-set-immediate': "error";
235
- '@atlaskit/platform/expand-border-shorthand': "error";
236
- '@atlaskit/platform/expand-background-shorthand': "error";
237
- '@atlaskit/platform/expand-spacing-shorthand': "error";
225
+ '@atlaskit/platform/no-module-level-eval': 'error';
226
+ '@atlaskit/platform/static-feature-flags': 'error';
227
+ '@atlaskit/platform/no-preconditioning': 'error';
228
+ '@atlaskit/platform/inline-usage': 'error';
229
+ '@atlaskit/platform/prefer-fg': 'error';
230
+ '@atlaskit/platform/no-alias': 'error';
231
+ '@atlaskit/platform/valid-gate-name': 'error';
232
+ '@atlaskit/platform/ensure-feature-flag-registration': 'error';
233
+ '@atlaskit/platform/ensure-test-runner-arguments': 'error';
234
+ '@atlaskit/platform/ensure-test-runner-nested-count': 'warn';
235
+ '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': 'error';
236
+ '@atlaskit/platform/no-invalid-feature-flag-usage': 'error';
237
+ '@atlaskit/platform/no-invalid-storybook-decorator-usage': 'error';
238
+ '@atlaskit/platform/ensure-atlassian-team': 'error';
239
+ '@atlaskit/platform/no-module-level-eval-nav4': 'error';
240
+ '@atlaskit/platform/no-direct-document-usage': 'warn';
241
+ '@atlaskit/platform/no-set-immediate': 'error';
242
+ '@atlaskit/platform/expand-border-shorthand': 'error';
243
+ '@atlaskit/platform/expand-background-shorthand': 'error';
244
+ '@atlaskit/platform/expand-spacing-shorthand': 'error';
245
+ '@atlaskit/platform/no-css-prop-in-object-spread': 'error';
238
246
  '@compiled/jsx-pragma': [
239
- "error",
247
+ 'error',
240
248
  {
241
249
  importSources: string[];
242
250
  onlyRunIfImportingCompiled: boolean;
@@ -251,28 +259,29 @@ declare const configs: {
251
259
  '@compiled': ESLint.Plugin;
252
260
  };
253
261
  rules: {
254
- '@atlaskit/platform/no-module-level-eval': "error";
255
- '@atlaskit/platform/static-feature-flags': "error";
256
- '@atlaskit/platform/no-preconditioning': "error";
257
- '@atlaskit/platform/inline-usage': "error";
258
- '@atlaskit/platform/prefer-fg': "error";
259
- '@atlaskit/platform/no-alias': "error";
260
- '@atlaskit/platform/valid-gate-name': "error";
261
- '@atlaskit/platform/ensure-feature-flag-registration': "error";
262
- '@atlaskit/platform/ensure-test-runner-arguments': "error";
263
- '@atlaskit/platform/ensure-test-runner-nested-count': "warn";
264
- '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': "error";
265
- '@atlaskit/platform/no-invalid-feature-flag-usage': "error";
266
- '@atlaskit/platform/no-invalid-storybook-decorator-usage': "error";
267
- '@atlaskit/platform/ensure-atlassian-team': "error";
268
- '@atlaskit/platform/no-module-level-eval-nav4': "error";
269
- '@atlaskit/platform/no-direct-document-usage': "warn";
270
- '@atlaskit/platform/no-set-immediate': "error";
271
- '@atlaskit/platform/expand-border-shorthand': "error";
272
- '@atlaskit/platform/expand-background-shorthand': "error";
273
- '@atlaskit/platform/expand-spacing-shorthand': "error";
262
+ '@atlaskit/platform/no-module-level-eval': 'error';
263
+ '@atlaskit/platform/static-feature-flags': 'error';
264
+ '@atlaskit/platform/no-preconditioning': 'error';
265
+ '@atlaskit/platform/inline-usage': 'error';
266
+ '@atlaskit/platform/prefer-fg': 'error';
267
+ '@atlaskit/platform/no-alias': 'error';
268
+ '@atlaskit/platform/valid-gate-name': 'error';
269
+ '@atlaskit/platform/ensure-feature-flag-registration': 'error';
270
+ '@atlaskit/platform/ensure-test-runner-arguments': 'error';
271
+ '@atlaskit/platform/ensure-test-runner-nested-count': 'warn';
272
+ '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': 'error';
273
+ '@atlaskit/platform/no-invalid-feature-flag-usage': 'error';
274
+ '@atlaskit/platform/no-invalid-storybook-decorator-usage': 'error';
275
+ '@atlaskit/platform/ensure-atlassian-team': 'error';
276
+ '@atlaskit/platform/no-module-level-eval-nav4': 'error';
277
+ '@atlaskit/platform/no-direct-document-usage': 'warn';
278
+ '@atlaskit/platform/no-set-immediate': 'error';
279
+ '@atlaskit/platform/expand-border-shorthand': 'error';
280
+ '@atlaskit/platform/expand-background-shorthand': 'error';
281
+ '@atlaskit/platform/expand-spacing-shorthand': 'error';
282
+ '@atlaskit/platform/no-css-prop-in-object-spread': 'error';
274
283
  '@compiled/jsx-pragma': [
275
- "error",
284
+ 'error',
276
285
  {
277
286
  importSources: string[];
278
287
  onlyRunIfImportingCompiled: boolean;
@@ -284,20 +293,21 @@ declare const configs: {
284
293
  jira: {
285
294
  plugins: string[];
286
295
  rules: {
287
- '@atlaskit/platform/ensure-test-runner-arguments': "error";
288
- '@atlaskit/platform/ensure-test-runner-nested-count': "warn";
289
- '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': "error";
290
- '@atlaskit/platform/no-invalid-feature-flag-usage': "error";
291
- '@atlaskit/platform/no-invalid-storybook-decorator-usage': "error";
292
- '@atlaskit/platform/ensure-atlassian-team': "error";
293
- '@atlaskit/platform/no-module-level-eval-nav4': "error";
294
- '@atlaskit/platform/no-direct-document-usage': "warn";
295
- '@atlaskit/platform/no-set-immediate': "error";
296
- '@atlaskit/platform/expand-border-shorthand': "error";
297
- '@atlaskit/platform/expand-background-shorthand': "error";
298
- '@atlaskit/platform/expand-spacing-shorthand': "error";
296
+ '@atlaskit/platform/ensure-test-runner-arguments': 'error';
297
+ '@atlaskit/platform/ensure-test-runner-nested-count': 'warn';
298
+ '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': 'error';
299
+ '@atlaskit/platform/no-invalid-feature-flag-usage': 'error';
300
+ '@atlaskit/platform/no-invalid-storybook-decorator-usage': 'error';
301
+ '@atlaskit/platform/ensure-atlassian-team': 'error';
302
+ '@atlaskit/platform/no-module-level-eval-nav4': 'error';
303
+ '@atlaskit/platform/no-direct-document-usage': 'warn';
304
+ '@atlaskit/platform/no-set-immediate': 'error';
305
+ '@atlaskit/platform/expand-border-shorthand': 'error';
306
+ '@atlaskit/platform/expand-background-shorthand': 'error';
307
+ '@atlaskit/platform/expand-spacing-shorthand': 'error';
308
+ '@atlaskit/platform/no-css-prop-in-object-spread': 'error';
299
309
  '@compiled/jsx-pragma': [
300
- "error",
310
+ 'error',
301
311
  {
302
312
  importSources: string[];
303
313
  onlyRunIfImportingCompiled: boolean;
@@ -312,20 +322,21 @@ declare const configs: {
312
322
  '@compiled': ESLint.Plugin;
313
323
  };
314
324
  rules: {
315
- '@atlaskit/platform/ensure-test-runner-arguments': "error";
316
- '@atlaskit/platform/ensure-test-runner-nested-count': "warn";
317
- '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': "error";
318
- '@atlaskit/platform/no-invalid-feature-flag-usage': "error";
319
- '@atlaskit/platform/no-invalid-storybook-decorator-usage': "error";
320
- '@atlaskit/platform/ensure-atlassian-team': "error";
321
- '@atlaskit/platform/no-module-level-eval-nav4': "error";
322
- '@atlaskit/platform/no-direct-document-usage': "warn";
323
- '@atlaskit/platform/no-set-immediate': "error";
324
- '@atlaskit/platform/expand-border-shorthand': "error";
325
- '@atlaskit/platform/expand-background-shorthand': "error";
326
- '@atlaskit/platform/expand-spacing-shorthand': "error";
325
+ '@atlaskit/platform/ensure-test-runner-arguments': 'error';
326
+ '@atlaskit/platform/ensure-test-runner-nested-count': 'warn';
327
+ '@atlaskit/platform/ensure-use-sync-external-store-server-snapshot': 'error';
328
+ '@atlaskit/platform/no-invalid-feature-flag-usage': 'error';
329
+ '@atlaskit/platform/no-invalid-storybook-decorator-usage': 'error';
330
+ '@atlaskit/platform/ensure-atlassian-team': 'error';
331
+ '@atlaskit/platform/no-module-level-eval-nav4': 'error';
332
+ '@atlaskit/platform/no-direct-document-usage': 'warn';
333
+ '@atlaskit/platform/no-set-immediate': 'error';
334
+ '@atlaskit/platform/expand-border-shorthand': 'error';
335
+ '@atlaskit/platform/expand-background-shorthand': 'error';
336
+ '@atlaskit/platform/expand-spacing-shorthand': 'error';
337
+ '@atlaskit/platform/no-css-prop-in-object-spread': 'error';
327
338
  '@compiled/jsx-pragma': [
328
- "error",
339
+ 'error',
329
340
  {
330
341
  importSources: string[];
331
342
  onlyRunIfImportingCompiled: boolean;
@@ -0,0 +1,3 @@
1
+ import type { Rule } from 'eslint';
2
+ export declare const noCssPropInObjectSpread: Rule.RuleModule;
3
+ export default noCssPropInObjectSpread;
@@ -0,0 +1,31 @@
1
+ import type { Rule } from 'eslint';
2
+ /**
3
+ * Disallows passing xcss() results into cx() when used in an xcss prop.
4
+ *
5
+ * xcss() from @atlaskit/primitives and cx() from @atlaskit/css / @compiled/react
6
+ * are incompatible — xcss() produces an opaque StyleRule object, while cx()
7
+ * expects Compiled atomic class name strings. Mixing them causes runtime errors.
8
+ * xcss() results must never be passed to cx(), whether inline or pre-defined.
9
+ *
10
+ * ❌ Wrong — xcss() called inline inside cx():
11
+ * xcss={cx(xcss({ color: 'red' }), xcss({ fontWeight: 'bold' }))}
12
+ *
13
+ * ❌ Also wrong — xcss() results pre-defined but still passed into cx():
14
+ * const baseStyles = xcss({ color: 'red' });
15
+ * const boldStyles = xcss({ fontWeight: 'bold' });
16
+ * xcss={cx(baseStyles, boldStyles)}
17
+ *
18
+ * ✅ Correct — pass xcss() results directly to the xcss prop (no cx()):
19
+ * const baseStyles = xcss({ color: 'red' });
20
+ * xcss={baseStyles}
21
+ *
22
+ * ✅ Correct — use cssMap() + cx() (cssMap is compatible with cx()):
23
+ * const styles = cssMap({ base: { color: 'red' } });
24
+ * xcss={cx(styles.base, condition && styles.focused)}
25
+ *
26
+ * This rule is import-aware: it only flags xcss() calls (inline or via variable)
27
+ * imported from @atlaskit/primitives inside cx() calls imported from @atlaskit/css
28
+ * or @compiled/react that appear inside an xcss prop.
29
+ */
30
+ declare const rule: Rule.RuleModule;
31
+ export default rule;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@atlaskit/eslint-plugin-platform",
3
3
  "description": "The essential plugin for use with Atlassian frontend platform tools",
4
- "version": "2.9.1",
4
+ "version": "2.9.2",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "atlassian": {
7
7
  "team": "Build Infra",