@atlaskit/eslint-plugin-ui-styling-standard 0.18.0 → 0.18.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.
Files changed (140) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/rules/no-imported-style-values/index.js +36 -5
  3. package/dist/es2019/rules/no-imported-style-values/index.js +36 -5
  4. package/dist/esm/rules/no-imported-style-values/index.js +36 -5
  5. package/package.json +1 -1
  6. package/afm-cc/tsconfig.json +0 -28
  7. package/afm-jira/tsconfig.json +0 -27
  8. package/build/tsconfig.json +0 -18
  9. package/constellation/atlaskit-theme/usage.mdx +0 -132
  10. package/constellation/consistent-css-prop-usage/usage.mdx +0 -7
  11. package/constellation/convert-props-syntax/usage.mdx +0 -130
  12. package/constellation/enforce-style-prop/usage.mdx +0 -47
  13. package/constellation/index/migration-guide.mdx +0 -309
  14. package/constellation/index/overview.mdx +0 -250
  15. package/constellation/index/props.mdx +0 -30
  16. package/constellation/local-cx-xcss/usage.mdx +0 -53
  17. package/constellation/no-array-arguments/usage.mdx +0 -49
  18. package/constellation/no-classname-prop/usage.mdx +0 -49
  19. package/constellation/no-container-queries/usage.mdx +0 -101
  20. package/constellation/no-css-tagged-template-expression/usage.mdx +0 -8
  21. package/constellation/no-dynamic-styles/usage.mdx +0 -130
  22. package/constellation/no-empty-styled-expression/usage.mdx +0 -8
  23. package/constellation/no-exported-css/usage.mdx +0 -8
  24. package/constellation/no-exported-keyframes/usage.mdx +0 -8
  25. package/constellation/no-exported-styles/usage.mdx +0 -87
  26. package/constellation/no-global-styles/usage.mdx +0 -60
  27. package/constellation/no-important-styles/usage.mdx +0 -33
  28. package/constellation/no-imported-style-values/usage.mdx +0 -157
  29. package/constellation/no-invalid-css-map/usage.mdx +0 -8
  30. package/constellation/no-js-xcss/usage.mdx +0 -7
  31. package/constellation/no-keyframes-tagged-template-expression/usage.mdx +0 -8
  32. package/constellation/no-nested-selectors/usage.mdx +0 -95
  33. package/constellation/no-styled/usage.mdx +0 -92
  34. package/constellation/no-styled-tagged-template-expression/usage.mdx +0 -8
  35. package/constellation/no-suppress-xcss/usage.mdx +0 -28
  36. package/constellation/no-unsafe-selectors/usage.mdx +0 -370
  37. package/constellation/no-unsafe-values/usage.mdx +0 -318
  38. package/constellation/use-compiled/usage.mdx +0 -54
  39. package/index.js +0 -24
  40. package/scripts/codegen.tsx +0 -373
  41. package/src/index.codegen.tsx +0 -14
  42. package/src/index.tsx +0 -1
  43. package/src/presets/all.codegen.tsx +0 -79
  44. package/src/presets/recommended.codegen.tsx +0 -79
  45. package/src/rules/TEMPLATE.md +0 -29
  46. package/src/rules/__tests__/utils/_tester.tsx +0 -40
  47. package/src/rules/atlaskit-theme/README.md +0 -130
  48. package/src/rules/atlaskit-theme/__tests__/test.ts +0 -133
  49. package/src/rules/atlaskit-theme/index.ts +0 -134
  50. package/src/rules/convert-props-syntax/README.md +0 -128
  51. package/src/rules/convert-props-syntax/__tests__/invalid.test.tsx +0 -76
  52. package/src/rules/convert-props-syntax/__tests__/rule.test.tsx +0 -584
  53. package/src/rules/convert-props-syntax/__tests__/type-annotations.test.tsx +0 -140
  54. package/src/rules/convert-props-syntax/__tests__/unusual-properties.test.tsx +0 -69
  55. package/src/rules/convert-props-syntax/index.tsx +0 -414
  56. package/src/rules/enforce-style-prop/README.md +0 -45
  57. package/src/rules/enforce-style-prop/__tests__/rule.test.tsx +0 -243
  58. package/src/rules/enforce-style-prop/index.tsx +0 -172
  59. package/src/rules/external-rules.tsx +0 -177
  60. package/src/rules/index.codegen.tsx +0 -42
  61. package/src/rules/local-cx-xcss/README.md +0 -51
  62. package/src/rules/local-cx-xcss/__tests__/rule.test.tsx +0 -102
  63. package/src/rules/local-cx-xcss/index.tsx +0 -62
  64. package/src/rules/no-array-arguments/README.md +0 -47
  65. package/src/rules/no-array-arguments/__tests__/rule.test.tsx +0 -107
  66. package/src/rules/no-array-arguments/index.tsx +0 -86
  67. package/src/rules/no-classname-prop/README.md +0 -47
  68. package/src/rules/no-classname-prop/__tests__/rule.test.tsx +0 -39
  69. package/src/rules/no-classname-prop/index.tsx +0 -34
  70. package/src/rules/no-container-queries/README.md +0 -99
  71. package/src/rules/no-container-queries/__tests__/rule.test.tsx +0 -139
  72. package/src/rules/no-container-queries/index.tsx +0 -94
  73. package/src/rules/no-dynamic-styles/README.md +0 -128
  74. package/src/rules/no-dynamic-styles/__tests__/rule.test.tsx +0 -135
  75. package/src/rules/no-dynamic-styles/index.tsx +0 -60
  76. package/src/rules/no-exported-styles/README.md +0 -85
  77. package/src/rules/no-exported-styles/__tests__/rule.test.tsx +0 -216
  78. package/src/rules/no-exported-styles/index.tsx +0 -52
  79. package/src/rules/no-global-styles/README.md +0 -58
  80. package/src/rules/no-global-styles/__tests__/no-css-modules.test.tsx +0 -33
  81. package/src/rules/no-global-styles/__tests__/no-global-styles.test.tsx +0 -46
  82. package/src/rules/no-global-styles/index.tsx +0 -82
  83. package/src/rules/no-important-styles/README.md +0 -31
  84. package/src/rules/no-important-styles/__tests__/rule.test.tsx +0 -165
  85. package/src/rules/no-important-styles/index.tsx +0 -70
  86. package/src/rules/no-imported-style-values/README.md +0 -155
  87. package/src/rules/no-imported-style-values/__tests__/rule.test.tsx +0 -491
  88. package/src/rules/no-imported-style-values/index.tsx +0 -188
  89. package/src/rules/no-nested-selectors/README.md +0 -93
  90. package/src/rules/no-nested-selectors/__tests__/rule.test.tsx +0 -335
  91. package/src/rules/no-nested-selectors/index.tsx +0 -99
  92. package/src/rules/no-styled/README.md +0 -90
  93. package/src/rules/no-styled/__tests__/rule.test.tsx +0 -73
  94. package/src/rules/no-styled/index.tsx +0 -45
  95. package/src/rules/no-unsafe-selectors/README.md +0 -368
  96. package/src/rules/no-unsafe-selectors/__tests__/no-ambiguous-pseudos.test.tsx +0 -368
  97. package/src/rules/no-unsafe-selectors/__tests__/no-grouped-at-rules.test.tsx +0 -57
  98. package/src/rules/no-unsafe-selectors/__tests__/no-increased-specificity.test.tsx +0 -73
  99. package/src/rules/no-unsafe-selectors/__tests__/no-keyframes-at-rules.test.tsx +0 -40
  100. package/src/rules/no-unsafe-selectors/__tests__/no-legacy-pseudo-element-syntax.test.tsx +0 -101
  101. package/src/rules/no-unsafe-selectors/__tests__/no-restricted-at-rules.test.tsx +0 -131
  102. package/src/rules/no-unsafe-selectors/__tests__/no-restricted-pseudos.test.tsx +0 -132
  103. package/src/rules/no-unsafe-selectors/__tests__/no-selectors-object.test.tsx +0 -25
  104. package/src/rules/no-unsafe-selectors/__tests__/no-unparsable-selectors.test.tsx +0 -35
  105. package/src/rules/no-unsafe-selectors/__tests__/rule.test.tsx +0 -257
  106. package/src/rules/no-unsafe-selectors/constants.tsx +0 -91
  107. package/src/rules/no-unsafe-selectors/index.tsx +0 -198
  108. package/src/rules/no-unsafe-selectors/lint-selector.tsx +0 -155
  109. package/src/rules/no-unsafe-selectors/source-position-utils.tsx +0 -55
  110. package/src/rules/no-unsafe-selectors/walk-css-map.tsx +0 -226
  111. package/src/rules/no-unsafe-values/README.md +0 -316
  112. package/src/rules/no-unsafe-values/__tests__/no-array-values.test.tsx +0 -27
  113. package/src/rules/no-unsafe-values/__tests__/no-conditional-values.test.tsx +0 -37
  114. package/src/rules/no-unsafe-values/__tests__/no-dynamic-keys.test.tsx +0 -229
  115. package/src/rules/no-unsafe-values/__tests__/no-function-calls.test.tsx +0 -267
  116. package/src/rules/no-unsafe-values/__tests__/no-identifier-arguments.test.tsx +0 -52
  117. package/src/rules/no-unsafe-values/__tests__/no-object-access.test.tsx +0 -106
  118. package/src/rules/no-unsafe-values/__tests__/no-object-references.test.tsx +0 -44
  119. package/src/rules/no-unsafe-values/__tests__/no-spread-elements.test.tsx +0 -48
  120. package/src/rules/no-unsafe-values/__tests__/no-unsafe-values.test.tsx +0 -75
  121. package/src/rules/no-unsafe-values/__tests__/no-variables.test.tsx +0 -121
  122. package/src/rules/no-unsafe-values/index.tsx +0 -94
  123. package/src/rules/no-unsafe-values/messages.tsx +0 -86
  124. package/src/rules/no-unsafe-values/utils.tsx +0 -387
  125. package/src/rules/use-compiled/README.md +0 -52
  126. package/src/rules/use-compiled/__tests__/can-auto-fix.test.tsx +0 -73
  127. package/src/rules/use-compiled/__tests__/css.test.tsx +0 -126
  128. package/src/rules/use-compiled/__tests__/imports.test.tsx +0 -158
  129. package/src/rules/use-compiled/__tests__/keyframes.test.tsx +0 -140
  130. package/src/rules/use-compiled/__tests__/pragma.test.tsx +0 -108
  131. package/src/rules/use-compiled/__tests__/styled.test.tsx +0 -114
  132. package/src/rules/use-compiled/__tests__/use-compiled.test.tsx +0 -15
  133. package/src/rules/use-compiled/index.tsx +0 -252
  134. package/src/rules/use-compiled/is-safe.tsx +0 -159
  135. package/src/rules/use-compiled/utils.tsx +0 -33
  136. package/src/rules/utils/create-rule-with-typed-config.tsx +0 -86
  137. package/src/rules/utils/create-rule.tsx +0 -13
  138. package/tsconfig.app.json +0 -47
  139. package/tsconfig.dev.json +0 -45
  140. package/tsconfig.json +0 -25
@@ -1,90 +0,0 @@
1
- Blocks the `styled` API, which creates unnecessary indirection.
2
-
3
- This indirection:
4
-
5
- - obfuscates which tag is being rendered
6
- - adds linting complexity
7
- - promotes exported styles
8
- - can complicate refactoring
9
-
10
- Use the `css` API instead. It has better performance and clarity.
11
-
12
- ## Examples
13
-
14
- ### Incorrect
15
-
16
- ```tsx
17
- import styled from 'styled-components';
18
-
19
- const Component = styled.div`
20
- color: red;
21
- `;
22
- export default styled.div({ color: 'red' });
23
- ```
24
-
25
- ```tsx
26
- import styled2 from '@emotion/styled';
27
-
28
- export const Component = styled2('div')`…`;
29
- ```
30
-
31
- ```tsx
32
- import styled from 'styled-components';
33
- import { styled as styled3 } from '@compiled/react';
34
-
35
- const Component = styled.div`color: red;`
36
- export const ComponentTwo = styled3(Component)({ … });
37
- ```
38
-
39
- ```tsx
40
- import styled from 'styled-components';
41
-
42
- export default styled.div.attrs((props) => ({ 'data-testid': props.testId }))({
43
- color: 'red',
44
- });
45
- ```
46
-
47
- ```tsx
48
- import styled from 'styled-components';
49
-
50
- export default styled.div.attrs((props) => ({ 'data-testid': props.testId }))`
51
- color: red;
52
- `;
53
- ```
54
-
55
- ### Correct
56
-
57
- ```tsx
58
- import { css, jsx } from '@emotion/react';
59
- import { token } from '@atlaskit/tokens';
60
-
61
- const styles = css({ color: token('color.text.subtlest') });
62
-
63
- const Component = ({ children }) => {
64
- return <div css={styles}>{children}</div>;
65
- };
66
- ```
67
-
68
- ```tsx
69
- import { Box, xcss } from '@atlaskit/primitives';
70
-
71
- const styles = xcss({
72
- color: 'color.text.subtlest',
73
- });
74
-
75
- const Component = ({ children }) => {
76
- return <Box xcss={styles}>{children}</Box>;
77
- };
78
- ```
79
-
80
- ## FAQ
81
-
82
- ### How will I extend like `styled(Button)`?
83
-
84
- Don't modify the styles of components you don't own, unless they provide an explicit bounded
85
- interface for doing so — such as the `xcss` prop.
86
-
87
- Use props (excluding `className` which is prohibited) to modify component styles instead.
88
-
89
- The Atlassian Design System, for example, no longer supports `styled(Button)` because it is unsafe
90
- for us to evolve the system with.
@@ -1,73 +0,0 @@
1
- import { tester } from '../../__tests__/utils/_tester';
2
- import rule from '../index';
3
-
4
- tester.run('no-styled', rule, {
5
- valid: [
6
- {
7
- code: `
8
- import { css, jsx } from '@emotion/react';
9
-
10
- const styles = css({ color: 'red' });
11
-
12
- const Component = ({ children }) => {
13
- return <div css={styles}>{children}</div>;
14
- };
15
- `,
16
- },
17
- {
18
- code: `
19
- import { Box, xcss } from '@atlaskit/primitives';
20
-
21
- const styles = xcss({
22
- color: 'color.text.subtlest',
23
- });
24
-
25
- const Component = ({ children }) => {
26
- return <Box xcss={styles}>{children}</Box>;
27
- };
28
- `,
29
- },
30
- ],
31
- invalid: [
32
- {
33
- code: `
34
- import styled from 'styled-components';
35
-
36
- const Component = styled.div\`color: red;\`
37
- `,
38
- errors: [{ messageId: 'no-styled' }],
39
- },
40
- {
41
- code: `
42
- import styled from 'styled-components';
43
-
44
- export default styled.div({ color: 'red' });
45
- `,
46
- errors: [{ messageId: 'no-styled' }],
47
- },
48
- {
49
- code: `
50
- import { styled as styled3 } from '@compiled/react';
51
-
52
- export const ComponentTwo = styled3(Component)({ color: 'blue' });
53
- `,
54
- errors: [{ messageId: 'no-styled' }],
55
- },
56
- {
57
- code: `
58
- import styled from 'styled-components';
59
-
60
- export default styled.div.attrs(props => ({ 'data-testid': props.testId }))({ color: 'red' });
61
- `,
62
- errors: [{ messageId: 'no-styled' }],
63
- },
64
- {
65
- code: `
66
- import styled from 'styled-components';
67
-
68
- export default styled.div.attrs(props => ({ 'data-testid': props.testId }))\`color: red\`;
69
- `,
70
- errors: [{ messageId: 'no-styled' }],
71
- },
72
- ],
73
- });
@@ -1,45 +0,0 @@
1
- import { type MemberExpression, type CallExpression } from 'eslint-codemod-utils';
2
- import { isStyled, getImportSources } from '@atlaskit/eslint-utils/is-supported-import';
3
-
4
- import { createLintRule } from '../utils/create-rule';
5
-
6
- export const rule = createLintRule({
7
- meta: {
8
- name: 'no-styled',
9
- docs: {
10
- description: 'Disallows usage of the `styled` imports',
11
- recommended: true,
12
- severity: 'error',
13
- },
14
- messages: {
15
- 'no-styled': "Avoid usages of styled, eg. styled.div, styled('div'), styled(Component), etc.",
16
- },
17
- type: 'problem',
18
- },
19
- create(context) {
20
- return {
21
- CallExpression: (node: CallExpression) => {
22
- const references = context.getScope().references;
23
- const importSources = getImportSources(context);
24
-
25
- if (isStyled(node, references, importSources)) {
26
- context.report({ node, messageId: 'no-styled' });
27
- }
28
- },
29
- MemberExpression: (node: MemberExpression) => {
30
- const references = context.getScope().references;
31
- const importSources = getImportSources(context);
32
-
33
- if (node.object.type === 'Identifier' && isStyled(node.object, references, importSources)) {
34
- const parent = context.getAncestors().at(-1);
35
- if (parent && (parent.type === 'CallExpression' || parent.type === 'MemberExpression')) {
36
- return;
37
- }
38
- context.report({ node, messageId: 'no-styled' });
39
- }
40
- },
41
- };
42
- },
43
- });
44
-
45
- export default rule;
@@ -1,368 +0,0 @@
1
- Blocks unsafe CSS selectors.
2
-
3
- Use alongside
4
- [no-nested-selectors](https://atlassian.design/components/eslint-plugin-ui-styling-standard/no-nested-selectors/usage)
5
- which blocks nested CSS selectors.
6
-
7
- Blocking unsafe selectors enables static analysis and also prevents regressions and incidents when
8
- migrating styles at scale.
9
-
10
- ## Examples
11
-
12
- ### Keyframes
13
-
14
- #### Incorrect
15
-
16
- Don't use `@keyframes` at-rules in styles.
17
-
18
- ```tsx
19
- import { css } from '@compiled/react';
20
-
21
- css({
22
- '@keyframes fadeIn': {
23
- from: {
24
- opacity: 0,
25
- },
26
- to: {
27
- opacity: 1,
28
- },
29
- },
30
- animation: '1s ease-in fadeIn',
31
- });
32
- ```
33
-
34
- #### Correct
35
-
36
- Use the `keyframes` API.
37
-
38
- ```tsx
39
- import { css, keyframes } from '@compiled/react';
40
-
41
- const fadeIn = keyframes({
42
- from: {
43
- opacity: 0,
44
- },
45
- to: {
46
- opacity: 1,
47
- },
48
- });
49
-
50
- css({
51
- animation: `1s ease-in ${fadeIn}`,
52
- });
53
- ```
54
-
55
- ### Legacy pseudo-element syntax
56
-
57
- #### Incorrect
58
-
59
- Don't use the legacy single colon syntax for pseudo-elements.
60
-
61
- This issue is autofixable.
62
-
63
- ```tsx
64
- import { css } from '@compiled/react';
65
-
66
- css({
67
- '&:after': {
68
- content: '""',
69
- },
70
- });
71
- ```
72
-
73
- #### Correct
74
-
75
- Use the double colon syntax for pseudo-elements.
76
-
77
- ```tsx
78
- import { css } from '@compiled/react';
79
-
80
- css({
81
- '&::after': {
82
- content: '""',
83
- },
84
- });
85
- ```
86
-
87
- ### Increased specificity selectors
88
-
89
- #### Incorrect
90
-
91
- Don't use the nesting selector to increase specificity of styles.
92
-
93
- ```tsx
94
- import { css } from '@compiled/react';
95
- import { token } from '@atlaskit/tokens';
96
-
97
- css({
98
- '&&': {
99
- color: token('color.text'),
100
- },
101
- });
102
- ```
103
-
104
- #### Correct
105
-
106
- Use styles that do not require increased specificity.
107
-
108
- ```tsx
109
- import { css } from '@compiled/react';
110
- import { token } from '@atlaskit/tokens';
111
-
112
- css({
113
- color: token('color.text'),
114
- });
115
- ```
116
-
117
- ### At-rules
118
-
119
- #### Incorrect
120
-
121
- Don't use at-rules in styles (see **Correct** below for exceptions).
122
-
123
- ```tsx
124
- import { css } from '@compiled/react';
125
-
126
- css({
127
- '@scope (.article-body) to (figure)': {
128
- img: {
129
- display: 'block',
130
- },
131
- },
132
- });
133
- ```
134
-
135
- #### Correct
136
-
137
- Use only allowed at-rules:
138
-
139
- - `@media` (through our
140
- [breakpoints](https://atlassian.design/components/primitives/responsive/breakpoints/examples))
141
- - `@property`
142
- - `@supports`
143
-
144
- ```tsx
145
- import { css } from '@compiled/react';
146
- import { media } from '@atlaskit/primitives/responsive';
147
-
148
- css({
149
- [media.above.sm]: {
150
- display: 'block',
151
- },
152
- });
153
- ```
154
-
155
- ### Restricted pseudo-selectors
156
-
157
- #### Incorrect
158
-
159
- Don't use pseudo-classes which take arguments or implicitly rely on external context.
160
-
161
- ```tsx
162
- import { css } from '@compiled/react';
163
- import { token } from '@atlaskit/tokens';
164
-
165
- css({
166
- '&:hover': {
167
- backgroundColor: token('color.background.neutral.hovered'),
168
- },
169
- '&:not(:hover)': {
170
- backgroundColor: token('color.background.neutral'),
171
- }
172
- '&:first-child': {
173
- fontWeight: token('font.weight.bold'),
174
- },
175
- });
176
- ```
177
-
178
- #### Correct
179
-
180
- ```tsx
181
- import { css } from '@compiled/react';
182
- import { token } from '@atlaskit/tokens';
183
-
184
- type Props = { isFirstChild: boolean };
185
-
186
- const baseStyles = css({
187
- backgroundColor: token('color.background.neutral'),
188
- '&:hover': {
189
- backgroundColor: token('color.background.neutral.hovered'),
190
- },
191
- });
192
-
193
- const firstChildStyles = css({
194
- fontWeight: token('font.weight.bold'),
195
- });
196
-
197
- const Component = ({ isFirstChild }: Props) => (
198
- <div css={[baseStyles, isFirstChild && firstChildStyles]} />
199
- );
200
- ```
201
-
202
- ### Ambiguous pseudo-selectors
203
-
204
- #### Incorrect
205
-
206
- Don't use pseudo-selectors without a leading selector, as they are ambiguous and interpreted
207
- differently between contexts.
208
-
209
- For example some contexts will treat `:hover` as `&:hover` while others will treat it as `& :hover`
210
- (which targets descendants).
211
-
212
- This issue is autofixable. By default a nesting selector `&` is added unless the
213
- `shouldAlwaysInsertNestingSelectorForAmbiguousPseudos` option is disabled.
214
-
215
- ```tsx
216
- import { css } from '@compiled/react';
217
-
218
- css({
219
- /**
220
- * This pseudo-class has no leading selector and is ambiguous.
221
- */
222
- ':hover': {},
223
-
224
- /**
225
- * In some contexts the above is treated as implicitly containing a nesting selector.
226
- */
227
- '&:hover': {},
228
-
229
- /**
230
- * In other contexts it is treated as a descendant selector.
231
- *
232
- * (The selectors below are equivalent.)
233
- */
234
- '*:hover': {},
235
- '& :hover': {},
236
- '& *:hover': {},
237
- });
238
- ```
239
-
240
- #### Correct
241
-
242
- Use explicit selectors. Do not rely on implicit or undefined behavior for pseudo-selectors.
243
-
244
- ```tsx
245
-
246
- ```
247
-
248
- ### Grouped at-rules
249
-
250
- #### Incorrect
251
-
252
- Don't group at-rules with the `cssMap` API.
253
-
254
- ````tsx
255
- import { cssMap } from '@compiled/react';
256
-
257
- ```tsx
258
- cssMap({
259
- success: {
260
- '@media': {
261
- '(min-width: 900px)': {},
262
- '(min-width: 1200px)': {},
263
- },
264
- },
265
- });
266
- ````
267
-
268
- #### Correct
269
-
270
- Write flattened at-rules instead.
271
-
272
- ```tsx
273
- cssMap({
274
- success: {
275
- selectors: {
276
- '&:not(:active)': {
277
- backgroundColor: 'white',
278
- },
279
- },
280
- },
281
- });
282
- ```
283
-
284
- ### Correct
285
-
286
- ```tsx
287
- const fadeIn = keyframes({
288
- from: {
289
- opacity: 0,
290
- },
291
- to: {
292
- opacity: 1,
293
- },
294
- });
295
-
296
- css({
297
- animationName: fadeIn,
298
- });
299
- ```
300
-
301
- ```tsx
302
- css({
303
- '::after': {
304
- content: '""',
305
- width: 100,
306
- height: 100,
307
- backgroundColor: 'red',
308
- },
309
- });
310
- ```
311
-
312
- ```tsx
313
- css({
314
- '&:first-of-type': {
315
- width: 100,
316
- },
317
- });
318
- ```
319
-
320
- ```tsx
321
- css({
322
- '&:hover': {},
323
- });
324
- ```
325
-
326
- ```tsx
327
- cssMap({
328
- success: {
329
- '@media (min-width: 900px)': {},
330
- '@media (min-width: 1200px)': {},
331
- },
332
- });
333
- ```
334
-
335
- ```tsx
336
- cssMap({
337
- success: {
338
- backgroundColor: 'white',
339
- '&:active': {
340
- backgroundColor: 'green',
341
- },
342
- },
343
- });
344
- ```
345
-
346
- ## Options
347
-
348
- ### `importSources: string[]`
349
-
350
- By default, this rule will check styles using:
351
-
352
- - `@atlaskit/css`
353
- - `@atlaskit/primitives`
354
- - `@compiled/react`
355
- - `@emotion/react`
356
- - `@emotion/core`
357
- - `@emotion/styled`
358
- - `styled-components`
359
-
360
- Override this list with the `importSources` option, which accepts an array of package names.
361
-
362
- ### `shouldAlwaysInsertNestingSelectorForAmbiguousPseudos: boolean`
363
-
364
- By default this rule will always fix ambiguous pseudo-selectors by inserting a leading `&` (nesting
365
- selector).
366
-
367
- Set `shouldAlwaysInsertNestingSelectorForAmbiguousPseudos` to `false` to disable this auto-fix. When
368
- disabled, a suggestion will be provided instead of an auto-fix.