@atlaskit/eslint-plugin-ui-styling-standard 0.15.2 → 0.16.1

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 (105) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/constellation/consistent-css-prop-usage/usage.mdx +3 -1
  3. package/constellation/index/migration-guide.mdx +309 -0
  4. package/constellation/index/overview.mdx +4 -0
  5. package/constellation/index/props.mdx +9 -5
  6. package/constellation/no-css-tagged-template-expression/usage.mdx +5 -2
  7. package/constellation/no-empty-styled-expression/usage.mdx +5 -2
  8. package/constellation/no-exported-css/usage.mdx +5 -2
  9. package/constellation/no-exported-keyframes/usage.mdx +5 -2
  10. package/constellation/no-invalid-css-map/usage.mdx +5 -2
  11. package/constellation/no-js-xcss/usage.mdx +3 -1
  12. package/constellation/no-keyframes-tagged-template-expression/usage.mdx +5 -2
  13. package/constellation/no-styled-tagged-template-expression/usage.mdx +5 -2
  14. package/constellation/no-suppress-xcss/usage.mdx +6 -3
  15. package/dist/types/rules/no-unsafe-selectors/constants.d.ts +1 -4
  16. package/index.js +9 -9
  17. package/package.json +3 -3
  18. package/scripts/codegen.tsx +223 -284
  19. package/src/rules/__tests__/utils/_tester.tsx +24 -24
  20. package/src/rules/atlaskit-theme/README.md +21 -19
  21. package/src/rules/atlaskit-theme/__tests__/test.ts +53 -53
  22. package/src/rules/atlaskit-theme/index.ts +107 -115
  23. package/src/rules/convert-props-syntax/README.md +32 -22
  24. package/src/rules/convert-props-syntax/__tests__/invalid.test.tsx +46 -46
  25. package/src/rules/convert-props-syntax/__tests__/rule.test.tsx +175 -175
  26. package/src/rules/convert-props-syntax/__tests__/type-annotations.test.tsx +52 -52
  27. package/src/rules/convert-props-syntax/__tests__/unusual-properties.test.tsx +33 -33
  28. package/src/rules/convert-props-syntax/index.tsx +356 -386
  29. package/src/rules/enforce-style-prop/README.md +21 -18
  30. package/src/rules/enforce-style-prop/__tests__/rule.test.tsx +90 -96
  31. package/src/rules/enforce-style-prop/index.tsx +144 -160
  32. package/src/rules/external-rules.tsx +163 -164
  33. package/src/rules/local-cx-xcss/README.md +10 -6
  34. package/src/rules/local-cx-xcss/__tests__/rule.test.tsx +26 -26
  35. package/src/rules/local-cx-xcss/index.tsx +46 -56
  36. package/src/rules/no-array-arguments/README.md +2 -1
  37. package/src/rules/no-array-arguments/__tests__/rule.test.tsx +37 -46
  38. package/src/rules/no-array-arguments/index.tsx +68 -69
  39. package/src/rules/no-classname-prop/README.md +7 -4
  40. package/src/rules/no-classname-prop/__tests__/rule.test.tsx +22 -22
  41. package/src/rules/no-classname-prop/index.tsx +25 -25
  42. package/src/rules/no-container-queries/README.md +11 -9
  43. package/src/rules/no-container-queries/__tests__/rule.test.tsx +47 -50
  44. package/src/rules/no-container-queries/index.tsx +75 -81
  45. package/src/rules/no-dynamic-styles/README.md +16 -19
  46. package/src/rules/no-dynamic-styles/__tests__/rule.test.tsx +58 -67
  47. package/src/rules/no-dynamic-styles/index.tsx +45 -48
  48. package/src/rules/no-exported-styles/README.md +17 -12
  49. package/src/rules/no-exported-styles/__tests__/rule.test.tsx +102 -111
  50. package/src/rules/no-exported-styles/index.tsx +36 -36
  51. package/src/rules/no-global-styles/README.md +15 -14
  52. package/src/rules/no-global-styles/__tests__/no-css-modules.test.tsx +28 -28
  53. package/src/rules/no-global-styles/__tests__/no-global-styles.test.tsx +37 -37
  54. package/src/rules/no-global-styles/index.tsx +59 -62
  55. package/src/rules/no-important-styles/README.md +5 -3
  56. package/src/rules/no-important-styles/__tests__/rule.test.tsx +66 -66
  57. package/src/rules/no-important-styles/index.tsx +49 -49
  58. package/src/rules/no-imported-style-values/README.md +23 -15
  59. package/src/rules/no-imported-style-values/__tests__/rule.test.tsx +123 -123
  60. package/src/rules/no-imported-style-values/index.tsx +116 -120
  61. package/src/rules/no-nested-selectors/README.md +15 -13
  62. package/src/rules/no-nested-selectors/__tests__/rule.test.tsx +141 -128
  63. package/src/rules/no-styled/README.md +14 -9
  64. package/src/rules/no-styled/__tests__/rule.test.tsx +31 -31
  65. package/src/rules/no-styled/index.tsx +34 -41
  66. package/src/rules/no-unsafe-selectors/README.md +103 -93
  67. package/src/rules/no-unsafe-selectors/__tests__/no-grouped-at-rules.test.tsx +21 -24
  68. package/src/rules/no-unsafe-selectors/__tests__/no-increased-specificity.test.tsx +44 -44
  69. package/src/rules/no-unsafe-selectors/__tests__/no-keyframes-at-rules.test.tsx +21 -21
  70. package/src/rules/no-unsafe-selectors/__tests__/no-legacy-pseudo-element-syntax.test.tsx +57 -57
  71. package/src/rules/no-unsafe-selectors/__tests__/no-restricted-at-rules.test.tsx +58 -58
  72. package/src/rules/no-unsafe-selectors/__tests__/no-restricted-pseudos.test.tsx +85 -85
  73. package/src/rules/no-unsafe-selectors/__tests__/no-selectors-object.test.tsx +12 -12
  74. package/src/rules/no-unsafe-selectors/__tests__/no-unparsable-selectors.test.tsx +23 -23
  75. package/src/rules/no-unsafe-selectors/__tests__/rule.test.tsx +133 -114
  76. package/src/rules/no-unsafe-selectors/constants.tsx +69 -77
  77. package/src/rules/no-unsafe-selectors/source-position-utils.tsx +38 -38
  78. package/src/rules/no-unsafe-selectors/walk-css-map.tsx +178 -184
  79. package/src/rules/no-unsafe-values/README.md +34 -40
  80. package/src/rules/no-unsafe-values/__tests__/no-array-values.test.tsx +13 -13
  81. package/src/rules/no-unsafe-values/__tests__/no-conditional-values.test.tsx +18 -18
  82. package/src/rules/no-unsafe-values/__tests__/no-dynamic-keys.test.tsx +104 -104
  83. package/src/rules/no-unsafe-values/__tests__/no-function-calls.test.tsx +128 -128
  84. package/src/rules/no-unsafe-values/__tests__/no-identifier-arguments.test.tsx +23 -23
  85. package/src/rules/no-unsafe-values/__tests__/no-object-access.test.tsx +38 -38
  86. package/src/rules/no-unsafe-values/__tests__/no-object-references.test.tsx +18 -18
  87. package/src/rules/no-unsafe-values/__tests__/no-spread-elements.test.tsx +18 -18
  88. package/src/rules/no-unsafe-values/__tests__/no-unsafe-values.test.tsx +28 -28
  89. package/src/rules/no-unsafe-values/__tests__/no-variables.test.tsx +47 -47
  90. package/src/rules/no-unsafe-values/index.tsx +76 -78
  91. package/src/rules/no-unsafe-values/messages.tsx +12 -12
  92. package/src/rules/no-unsafe-values/utils.tsx +370 -382
  93. package/src/rules/use-compiled/README.md +11 -8
  94. package/src/rules/use-compiled/__tests__/can-auto-fix.test.tsx +32 -32
  95. package/src/rules/use-compiled/__tests__/css.test.tsx +53 -53
  96. package/src/rules/use-compiled/__tests__/imports.test.tsx +90 -95
  97. package/src/rules/use-compiled/__tests__/keyframes.test.tsx +47 -47
  98. package/src/rules/use-compiled/__tests__/pragma.test.tsx +64 -64
  99. package/src/rules/use-compiled/__tests__/styled.test.tsx +53 -53
  100. package/src/rules/use-compiled/__tests__/use-compiled.test.tsx +10 -10
  101. package/src/rules/use-compiled/index.tsx +203 -226
  102. package/src/rules/use-compiled/is-safe.tsx +113 -117
  103. package/src/rules/use-compiled/utils.tsx +14 -18
  104. package/src/rules/utils/create-rule-with-typed-config.tsx +62 -63
  105. package/src/rules/utils/create-rule.tsx +3 -6
@@ -1,52 +1,45 @@
1
1
  import { type MemberExpression, type CallExpression } from 'eslint-codemod-utils';
2
2
  import { isStyled, getImportSources } from '@atlaskit/eslint-utils/is-supported-import';
3
3
 
4
-
5
4
  import { createLintRule } from '../utils/create-rule';
6
5
 
7
6
  export const rule = createLintRule({
8
- meta: {
9
- name: 'no-styled',
10
- docs: {
11
- description: 'Disallows usage of the `styled` imports',
12
- recommended: true,
13
- severity: 'warn',
14
- },
15
- messages: {
16
- 'no-styled': "Avoid usages of styled, eg. styled.div, styled('div'), styled(Component), etc.",
17
- },
18
- type: 'problem',
19
- },
20
- create(context) {
21
- return {
22
- CallExpression: (node: CallExpression) => {
23
- const references = context.getScope().references;
24
- const importSources = getImportSources(context);
25
-
26
- if (
27
- isStyled(node, references, importSources)
28
- ) {
29
- context.report({ node, messageId: 'no-styled' });
30
- }
7
+ meta: {
8
+ name: 'no-styled',
9
+ docs: {
10
+ description: 'Disallows usage of the `styled` imports',
11
+ recommended: true,
12
+ severity: 'warn',
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);
31
24
 
32
- },
33
- MemberExpression: (node: MemberExpression) => {
34
- const references = context.getScope().references;
35
- const importSources = getImportSources(context);
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);
36
32
 
37
- if (
38
- node.object.type === 'Identifier' &&
39
- isStyled(node.object, references, importSources)
40
- ) {
41
- const parent = context.getAncestors().at(-1);
42
- if (parent && (parent.type === 'CallExpression' || parent.type === 'MemberExpression')) {
43
- return;
44
- }
45
- context.report({ node, messageId: 'no-styled' });
46
- }
47
- },
48
- };
49
- },
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
+ },
50
43
  });
51
44
 
52
45
  export default rule;
@@ -1,8 +1,11 @@
1
1
  Disallows unsafe selectors in CSS-in-JS style objects.
2
2
 
3
- This enables static analysis and prevents regressions and incidents when migrating between styling APIs.
3
+ This enables static analysis and prevents regressions and incidents when migrating between styling
4
+ APIs.
4
5
 
5
- Use this rule alongside [no-nested-selectors](https://atlassian.design/components/eslint-plugin-ui-styling-standard/no-nested-selectors/usage) as the rules are complementary.
6
+ Use this rule alongside
7
+ [no-nested-selectors](https://atlassian.design/components/eslint-plugin-ui-styling-standard/no-nested-selectors/usage)
8
+ as the rules are complementary.
6
9
 
7
10
  ## Examples
8
11
 
@@ -14,14 +17,14 @@ Use the `keyframes` CSS-in-JS API instead.
14
17
 
15
18
  ```ts
16
19
  css({
17
- '@keyframes fadeIn': {
18
- from: {
19
- opacity: 0,
20
- },
21
- to: {
22
- opacity: 1,
23
- },
24
- },
20
+ '@keyframes fadeIn': {
21
+ from: {
22
+ opacity: 0,
23
+ },
24
+ to: {
25
+ opacity: 1,
26
+ },
27
+ },
25
28
  });
26
29
  ```
27
30
 
@@ -33,12 +36,12 @@ _Auto-fixer is available for this violation._
33
36
 
34
37
  ```ts
35
38
  css({
36
- ':after': {
37
- content: '""',
38
- width: 100,
39
- height: 100,
40
- backgroundColor: 'red',
41
- },
39
+ ':after': {
40
+ content: '""',
41
+ width: 100,
42
+ height: 100,
43
+ backgroundColor: 'red',
44
+ },
42
45
  });
43
46
  ```
44
47
 
@@ -48,9 +51,9 @@ Use styles that do not require increased specificity.
48
51
 
49
52
  ```ts
50
53
  css({
51
- '&&': {
52
- color: 'red',
53
- },
54
+ '&&': {
55
+ color: 'red',
56
+ },
54
57
  });
55
58
  ```
56
59
 
@@ -58,11 +61,11 @@ css({
58
61
 
59
62
  ```ts
60
63
  css({
61
- '@scope (.article-body) to (figure)': {
62
- img: {
63
- display: 'block',
64
- },
65
- },
64
+ '@scope (.article-body) to (figure)': {
65
+ img: {
66
+ display: 'block',
67
+ },
68
+ },
66
69
  });
67
70
  ```
68
71
 
@@ -70,44 +73,49 @@ css({
70
73
 
71
74
  ```ts
72
75
  css({
73
- '&:first-child': {
74
- width: 100,
75
- },
76
+ '&:first-child': {
77
+ width: 100,
78
+ },
76
79
  });
77
80
  ```
78
81
 
79
82
  **No ambiguous pseudos**
80
83
 
81
- A pseudo-selector without a leading selector is ambiguous and is interpreted differently between contexts.
84
+ A pseudo-selector without a leading selector is ambiguous and is interpreted differently between
85
+ contexts.
82
86
 
83
- Most CSS-in-JS libraries will implicitly add the nesting selector `&` before ambiguous pseudo-selectors. This is often the desired behavior.
87
+ Most CSS-in-JS libraries will implicitly add the nesting selector `&` before ambiguous
88
+ pseudo-selectors. This is often the desired behavior.
84
89
 
85
- The CSS nesting specification, CSS pre-processors, newer versions of `styled-components` (version 6+) and potentially future versions of `@emotion/*` will treat ambiguous pseudo-selectors as descendant selectors.
90
+ The CSS nesting specification, CSS pre-processors, newer versions of `styled-components` (version
91
+ 6+) and potentially future versions of `@emotion/*` will treat ambiguous pseudo-selectors as
92
+ descendant selectors.
86
93
 
87
94
  Use explicit selectors. Do not rely on implicit behavior for pseudo-selectors.
88
95
 
89
- _Auto-fixer is available for this violation. By default a nesting selector `&` is added unless the `shouldAlwaysInsertNestingSelectorForAmbiguousPseudos` option is disabled._
96
+ _Auto-fixer is available for this violation. By default a nesting selector `&` is added unless the
97
+ `shouldAlwaysInsertNestingSelectorForAmbiguousPseudos` option is disabled._
90
98
 
91
99
  ```ts
92
100
  css({
93
- /**
94
- * This pseudo-class has no leading selector and is ambiguous.
95
- */
96
- ':hover': {},
97
-
98
- /**
99
- * In some contexts the above is treated as implicitly containing a nesting selector.
100
- */
101
- '&:hover': {},
102
-
103
- /**
104
- * In other contexts it is treated as a descendant selector.
105
- *
106
- * (The selectors below are equivalent.)
107
- */
108
- '*:hover': {},
109
- '& :hover': {},
110
- '& *:hover': {},
101
+ /**
102
+ * This pseudo-class has no leading selector and is ambiguous.
103
+ */
104
+ ':hover': {},
105
+
106
+ /**
107
+ * In some contexts the above is treated as implicitly containing a nesting selector.
108
+ */
109
+ '&:hover': {},
110
+
111
+ /**
112
+ * In other contexts it is treated as a descendant selector.
113
+ *
114
+ * (The selectors below are equivalent.)
115
+ */
116
+ '*:hover': {},
117
+ '& :hover': {},
118
+ '& *:hover': {},
111
119
  });
112
120
  ```
113
121
 
@@ -119,12 +127,12 @@ Write flattened at-rules instead.
119
127
 
120
128
  ```ts
121
129
  cssMap({
122
- success: {
123
- '@media': {
124
- '(min-width: 900px)': {},
125
- '(min-width: 1200px)': {},
126
- },
127
- },
130
+ success: {
131
+ '@media': {
132
+ '(min-width: 900px)': {},
133
+ '(min-width: 1200px)': {},
134
+ },
135
+ },
128
136
  });
129
137
  ```
130
138
 
@@ -136,13 +144,13 @@ Refactor your styles so it is not required.
136
144
 
137
145
  ```ts
138
146
  cssMap({
139
- success: {
140
- selectors: {
141
- '&:not(:active)': {
142
- backgroundColor: 'white',
143
- },
144
- },
145
- },
147
+ success: {
148
+ selectors: {
149
+ '&:not(:active)': {
150
+ backgroundColor: 'white',
151
+ },
152
+ },
153
+ },
146
154
  });
147
155
  ```
148
156
 
@@ -150,61 +158,61 @@ cssMap({
150
158
 
151
159
  ```ts
152
160
  const fadeIn = keyframes({
153
- from: {
154
- opacity: 0,
155
- },
156
- to: {
157
- opacity: 1,
158
- },
161
+ from: {
162
+ opacity: 0,
163
+ },
164
+ to: {
165
+ opacity: 1,
166
+ },
159
167
  });
160
168
 
161
169
  css({
162
- animationName: fadeIn,
170
+ animationName: fadeIn,
163
171
  });
164
172
  ```
165
173
 
166
174
  ```ts
167
175
  css({
168
- '::after': {
169
- content: '""',
170
- width: 100,
171
- height: 100,
172
- backgroundColor: 'red',
173
- },
176
+ '::after': {
177
+ content: '""',
178
+ width: 100,
179
+ height: 100,
180
+ backgroundColor: 'red',
181
+ },
174
182
  });
175
183
  ```
176
184
 
177
185
  ```ts
178
186
  css({
179
- '&:first-of-type': {
180
- width: 100,
181
- },
187
+ '&:first-of-type': {
188
+ width: 100,
189
+ },
182
190
  });
183
191
  ```
184
192
 
185
193
  ```ts
186
194
  css({
187
- '&:hover': {},
195
+ '&:hover': {},
188
196
  });
189
197
  ```
190
198
 
191
199
  ```ts
192
200
  cssMap({
193
- success: {
194
- '@media (min-width: 900px)': {},
195
- '@media (min-width: 1200px)': {},
196
- },
201
+ success: {
202
+ '@media (min-width: 900px)': {},
203
+ '@media (min-width: 1200px)': {},
204
+ },
197
205
  });
198
206
  ```
199
207
 
200
208
  ```ts
201
209
  cssMap({
202
- success: {
203
- backgroundColor: 'white',
204
- '&:active': {
205
- backgroundColor: 'green',
206
- },
207
- },
210
+ success: {
211
+ backgroundColor: 'white',
212
+ '&:active': {
213
+ backgroundColor: 'green',
214
+ },
215
+ },
208
216
  });
209
217
  ```
210
218
 
@@ -222,11 +230,13 @@ By default, this rule will check `css` usages from:
222
230
  - `@emotion/styled`
223
231
  - `styled-components`
224
232
 
225
- To change this list of libraries, you can define a custom set of `importSources`, which accepts an array of package names (strings).
226
- This will override the built-in allow-list.
233
+ To change this list of libraries, you can define a custom set of `importSources`, which accepts an
234
+ array of package names (strings). This will override the built-in allow-list.
227
235
 
228
236
  ### `shouldAlwaysInsertNestingSelectorForAmbiguousPseudos: boolean`
229
237
 
230
- By default this rule will always fix ambiguous pseudo-selectors by inserting a leading `&` (nesting selector).
238
+ By default this rule will always fix ambiguous pseudo-selectors by inserting a leading `&` (nesting
239
+ selector).
231
240
 
232
- Set `shouldAlwaysInsertNestingSelectorForAmbiguousPseudos` to `false` to disable this auto-fix. When disabled, a suggestion will be provided instead of an auto-fix.
241
+ Set `shouldAlwaysInsertNestingSelectorForAmbiguousPseudos` to `false` to disable this auto-fix. When
242
+ disabled, a suggestion will be provided instead of an auto-fix.
@@ -2,11 +2,11 @@ import { tester } from '../../__tests__/utils/_tester';
2
2
  import rule from '../index';
3
3
 
4
4
  tester.run('no-grouped-at-rules', rule, {
5
- valid: [],
6
- invalid: [
7
- {
8
- name: '@media grouping',
9
- code: `
5
+ valid: [],
6
+ invalid: [
7
+ {
8
+ name: '@media grouping',
9
+ code: `
10
10
  import { cssMap } from '@compiled/react';
11
11
 
12
12
  cssMap({
@@ -18,11 +18,11 @@ tester.run('no-grouped-at-rules', rule, {
18
18
  }
19
19
  });
20
20
  `,
21
- errors: [{ messageId: 'no-grouped-at-rules' }],
22
- },
23
- {
24
- name: '@keyframes grouping',
25
- code: `
21
+ errors: [{ messageId: 'no-grouped-at-rules' }],
22
+ },
23
+ {
24
+ name: '@keyframes grouping',
25
+ code: `
26
26
  import { cssMap } from '@compiled/react';
27
27
 
28
28
  cssMap({
@@ -33,14 +33,11 @@ tester.run('no-grouped-at-rules', rule, {
33
33
  }
34
34
  });
35
35
  `,
36
- errors: [
37
- { messageId: 'no-grouped-at-rules' },
38
- { messageId: 'no-keyframes-at-rules' },
39
- ],
40
- },
41
- {
42
- name: '@scope grouping',
43
- code: `
36
+ errors: [{ messageId: 'no-grouped-at-rules' }, { messageId: 'no-keyframes-at-rules' }],
37
+ },
38
+ {
39
+ name: '@scope grouping',
40
+ code: `
44
41
  import { cssMap } from '@compiled/react';
45
42
 
46
43
  cssMap({
@@ -51,10 +48,10 @@ tester.run('no-grouped-at-rules', rule, {
51
48
  }
52
49
  });
53
50
  `,
54
- errors: [
55
- { messageId: 'no-grouped-at-rules' },
56
- { messageId: 'no-restricted-at-rules', data: { atRule: '@scope' } },
57
- ],
58
- },
59
- ],
51
+ errors: [
52
+ { messageId: 'no-grouped-at-rules' },
53
+ { messageId: 'no-restricted-at-rules', data: { atRule: '@scope' } },
54
+ ],
55
+ },
56
+ ],
60
57
  });
@@ -2,72 +2,72 @@ import { tester } from '../../__tests__/utils/_tester';
2
2
  import rule from '../index';
3
3
 
4
4
  tester.run('no-increased-specificity', rule, {
5
- valid: [
6
- {
7
- name: 'multiple & in selector list',
8
- code: `
5
+ valid: [
6
+ {
7
+ name: 'multiple & in selector list',
8
+ code: `
9
9
  import { css } from '@compiled/react';
10
10
 
11
11
  css({
12
12
  '&:hover, &:active': {},
13
13
  });
14
14
  `,
15
- },
16
- ],
17
- invalid: [
18
- {
19
- name: 'single &',
20
- code: `
15
+ },
16
+ ],
17
+ invalid: [
18
+ {
19
+ name: 'single &',
20
+ code: `
21
21
  import { css } from '@compiled/react';
22
22
 
23
23
  css({
24
24
  '&': {},
25
25
  });
26
26
  `,
27
- errors: [
28
- {
29
- messageId: 'no-increased-specificity',
30
- line: 5,
31
- column: 12,
32
- endColumn: 13,
33
- },
34
- ],
35
- },
36
- {
37
- name: 'double &',
38
- code: `
27
+ errors: [
28
+ {
29
+ messageId: 'no-increased-specificity',
30
+ line: 5,
31
+ column: 12,
32
+ endColumn: 13,
33
+ },
34
+ ],
35
+ },
36
+ {
37
+ name: 'double &',
38
+ code: `
39
39
  import { css } from '@compiled/react';
40
40
 
41
41
  css({
42
42
  '&&': {},
43
43
  });
44
44
  `,
45
- errors: [
46
- {
47
- messageId: 'no-increased-specificity',
48
- line: 5,
49
- column: 12,
50
- endColumn: 14,
51
- },
52
- ],
53
- },
54
- {
55
- name: 'longer chain of &',
56
- code: `
45
+ errors: [
46
+ {
47
+ messageId: 'no-increased-specificity',
48
+ line: 5,
49
+ column: 12,
50
+ endColumn: 14,
51
+ },
52
+ ],
53
+ },
54
+ {
55
+ name: 'longer chain of &',
56
+ code: `
57
57
  import { css } from '@compiled/react';
58
58
 
59
59
  css({
60
60
  '&&&&&&&&&': {},
61
61
  });
62
62
  `,
63
- errors: [
64
- {
65
- messageId: 'no-increased-specificity',
66
- line: 5,
67
- column: 12,
68
- endColumn: 21,
69
- },
70
- ],
71
- },
72
- ],
63
+ errors: [
64
+ {
65
+ messageId: 'no-increased-specificity',
66
+ line: 5,
67
+ column: 12,
68
+ endColumn: 21,
69
+ },
70
+ ],
71
+ },
72
+ ],
73
73
  });
@@ -2,26 +2,26 @@ import { tester } from '../../__tests__/utils/_tester';
2
2
  import rule from '../index';
3
3
 
4
4
  tester.run('no-keyframes-at-rules', rule, {
5
- valid: [],
6
- invalid: [
7
- {
8
- name: '@keyframes',
9
- code: `
5
+ valid: [],
6
+ invalid: [
7
+ {
8
+ name: '@keyframes',
9
+ code: `
10
10
  import { css } from '@compiled/react';
11
11
 
12
12
  css({
13
13
  '@keyframes fadeIn': {}
14
14
  });
15
15
  `,
16
- errors: [
17
- {
18
- messageId: 'no-keyframes-at-rules',
19
- },
20
- ],
21
- },
22
- {
23
- name: '@keyframes in cssMap',
24
- code: `
16
+ errors: [
17
+ {
18
+ messageId: 'no-keyframes-at-rules',
19
+ },
20
+ ],
21
+ },
22
+ {
23
+ name: '@keyframes in cssMap',
24
+ code: `
25
25
  import { cssMap } from '@compiled/react';
26
26
 
27
27
  cssMap({
@@ -30,11 +30,11 @@ tester.run('no-keyframes-at-rules', rule, {
30
30
  }
31
31
  });
32
32
  `,
33
- errors: [
34
- {
35
- messageId: 'no-keyframes-at-rules',
36
- },
37
- ],
38
- },
39
- ],
33
+ errors: [
34
+ {
35
+ messageId: 'no-keyframes-at-rules',
36
+ },
37
+ ],
38
+ },
39
+ ],
40
40
  });