@atlaskit/eslint-plugin-ui-styling-standard 0.15.1 → 0.16.0
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.
- package/CHANGELOG.md +17 -0
- package/constellation/index/migration-guide.mdx +309 -0
- package/constellation/index/overview.mdx +4 -0
- package/constellation/index/props.mdx +9 -5
- package/dist/cjs/rules/no-nested-selectors/index.js +68 -49
- package/dist/es2019/rules/no-nested-selectors/index.js +63 -45
- package/dist/esm/rules/no-nested-selectors/index.js +64 -49
- package/dist/types/rules/no-unsafe-selectors/constants.d.ts +1 -4
- package/index.js +9 -9
- package/package.json +3 -3
- package/scripts/codegen.tsx +223 -284
- package/src/rules/__tests__/utils/_tester.tsx +24 -24
- package/src/rules/atlaskit-theme/README.md +21 -19
- package/src/rules/atlaskit-theme/__tests__/test.ts +53 -53
- package/src/rules/atlaskit-theme/index.ts +107 -115
- package/src/rules/convert-props-syntax/README.md +32 -22
- package/src/rules/convert-props-syntax/__tests__/invalid.test.tsx +46 -46
- package/src/rules/convert-props-syntax/__tests__/rule.test.tsx +175 -175
- package/src/rules/convert-props-syntax/__tests__/type-annotations.test.tsx +52 -52
- package/src/rules/convert-props-syntax/__tests__/unusual-properties.test.tsx +33 -33
- package/src/rules/convert-props-syntax/index.tsx +356 -386
- package/src/rules/enforce-style-prop/README.md +21 -18
- package/src/rules/enforce-style-prop/__tests__/rule.test.tsx +90 -96
- package/src/rules/enforce-style-prop/index.tsx +144 -160
- package/src/rules/external-rules.tsx +163 -164
- package/src/rules/local-cx-xcss/README.md +10 -6
- package/src/rules/local-cx-xcss/__tests__/rule.test.tsx +26 -26
- package/src/rules/local-cx-xcss/index.tsx +46 -56
- package/src/rules/no-array-arguments/README.md +2 -1
- package/src/rules/no-array-arguments/__tests__/rule.test.tsx +37 -46
- package/src/rules/no-array-arguments/index.tsx +68 -69
- package/src/rules/no-classname-prop/README.md +7 -4
- package/src/rules/no-classname-prop/__tests__/rule.test.tsx +22 -22
- package/src/rules/no-classname-prop/index.tsx +25 -25
- package/src/rules/no-container-queries/README.md +11 -9
- package/src/rules/no-container-queries/__tests__/rule.test.tsx +47 -50
- package/src/rules/no-container-queries/index.tsx +75 -81
- package/src/rules/no-dynamic-styles/README.md +16 -19
- package/src/rules/no-dynamic-styles/__tests__/rule.test.tsx +58 -67
- package/src/rules/no-dynamic-styles/index.tsx +45 -48
- package/src/rules/no-exported-styles/README.md +17 -12
- package/src/rules/no-exported-styles/__tests__/rule.test.tsx +102 -111
- package/src/rules/no-exported-styles/index.tsx +36 -36
- package/src/rules/no-global-styles/README.md +15 -14
- package/src/rules/no-global-styles/__tests__/no-css-modules.test.tsx +28 -28
- package/src/rules/no-global-styles/__tests__/no-global-styles.test.tsx +37 -37
- package/src/rules/no-global-styles/index.tsx +59 -62
- package/src/rules/no-important-styles/README.md +5 -3
- package/src/rules/no-important-styles/__tests__/rule.test.tsx +66 -66
- package/src/rules/no-important-styles/index.tsx +49 -49
- package/src/rules/no-imported-style-values/README.md +23 -15
- package/src/rules/no-imported-style-values/__tests__/rule.test.tsx +123 -123
- package/src/rules/no-imported-style-values/index.tsx +116 -120
- package/src/rules/no-nested-selectors/README.md +15 -13
- package/src/rules/no-nested-selectors/__tests__/rule.test.tsx +186 -149
- package/src/rules/no-nested-selectors/index.tsx +92 -105
- package/src/rules/no-styled/README.md +14 -9
- package/src/rules/no-styled/__tests__/rule.test.tsx +31 -31
- package/src/rules/no-styled/index.tsx +34 -41
- package/src/rules/no-unsafe-selectors/README.md +103 -93
- package/src/rules/no-unsafe-selectors/__tests__/no-grouped-at-rules.test.tsx +21 -24
- package/src/rules/no-unsafe-selectors/__tests__/no-increased-specificity.test.tsx +44 -44
- package/src/rules/no-unsafe-selectors/__tests__/no-keyframes-at-rules.test.tsx +21 -21
- package/src/rules/no-unsafe-selectors/__tests__/no-legacy-pseudo-element-syntax.test.tsx +57 -57
- package/src/rules/no-unsafe-selectors/__tests__/no-restricted-at-rules.test.tsx +58 -58
- package/src/rules/no-unsafe-selectors/__tests__/no-restricted-pseudos.test.tsx +85 -85
- package/src/rules/no-unsafe-selectors/__tests__/no-selectors-object.test.tsx +12 -12
- package/src/rules/no-unsafe-selectors/__tests__/no-unparsable-selectors.test.tsx +23 -23
- package/src/rules/no-unsafe-selectors/__tests__/rule.test.tsx +114 -114
- package/src/rules/no-unsafe-selectors/constants.tsx +69 -77
- package/src/rules/no-unsafe-selectors/source-position-utils.tsx +38 -38
- package/src/rules/no-unsafe-selectors/walk-css-map.tsx +178 -184
- package/src/rules/no-unsafe-values/README.md +34 -40
- package/src/rules/no-unsafe-values/__tests__/no-array-values.test.tsx +13 -13
- package/src/rules/no-unsafe-values/__tests__/no-conditional-values.test.tsx +18 -18
- package/src/rules/no-unsafe-values/__tests__/no-dynamic-keys.test.tsx +104 -104
- package/src/rules/no-unsafe-values/__tests__/no-function-calls.test.tsx +128 -128
- package/src/rules/no-unsafe-values/__tests__/no-identifier-arguments.test.tsx +23 -23
- package/src/rules/no-unsafe-values/__tests__/no-object-access.test.tsx +38 -38
- package/src/rules/no-unsafe-values/__tests__/no-object-references.test.tsx +18 -18
- package/src/rules/no-unsafe-values/__tests__/no-spread-elements.test.tsx +18 -18
- package/src/rules/no-unsafe-values/__tests__/no-unsafe-values.test.tsx +28 -28
- package/src/rules/no-unsafe-values/__tests__/no-variables.test.tsx +47 -47
- package/src/rules/no-unsafe-values/index.tsx +76 -78
- package/src/rules/no-unsafe-values/messages.tsx +12 -12
- package/src/rules/no-unsafe-values/utils.tsx +370 -382
- package/src/rules/use-compiled/README.md +11 -8
- package/src/rules/use-compiled/__tests__/can-auto-fix.test.tsx +32 -32
- package/src/rules/use-compiled/__tests__/css.test.tsx +53 -53
- package/src/rules/use-compiled/__tests__/imports.test.tsx +90 -95
- package/src/rules/use-compiled/__tests__/keyframes.test.tsx +47 -47
- package/src/rules/use-compiled/__tests__/pragma.test.tsx +64 -64
- package/src/rules/use-compiled/__tests__/styled.test.tsx +53 -53
- package/src/rules/use-compiled/__tests__/use-compiled.test.tsx +10 -10
- package/src/rules/use-compiled/index.tsx +203 -226
- package/src/rules/use-compiled/is-safe.tsx +113 -117
- package/src/rules/use-compiled/utils.tsx +14 -18
- package/src/rules/utils/create-rule-with-typed-config.tsx +62 -63
- package/src/rules/utils/create-rule.tsx +3 -6
|
@@ -2,9 +2,9 @@ import { tester } from '../../__tests__/utils/_tester';
|
|
|
2
2
|
import rule from '../index';
|
|
3
3
|
|
|
4
4
|
tester.run('no-legacy-pseudo-element-syntax', rule, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
valid: [
|
|
6
|
+
{
|
|
7
|
+
code: `
|
|
8
8
|
import { css } from '@compiled/react';
|
|
9
9
|
|
|
10
10
|
css({
|
|
@@ -14,12 +14,12 @@ tester.run('no-legacy-pseudo-element-syntax', rule, {
|
|
|
14
14
|
'&::first-line': {},
|
|
15
15
|
});
|
|
16
16
|
`,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
invalid: [
|
|
20
|
+
{
|
|
21
|
+
name: 'single colon syntax for pseudo elements',
|
|
22
|
+
code: `
|
|
23
23
|
import { css } from '@compiled/react';
|
|
24
24
|
|
|
25
25
|
css({
|
|
@@ -29,7 +29,7 @@ tester.run('no-legacy-pseudo-element-syntax', rule, {
|
|
|
29
29
|
'&:first-line': {},
|
|
30
30
|
});
|
|
31
31
|
`,
|
|
32
|
-
|
|
32
|
+
output: `
|
|
33
33
|
import { css } from '@compiled/react';
|
|
34
34
|
|
|
35
35
|
css({
|
|
@@ -39,63 +39,63 @@ tester.run('no-legacy-pseudo-element-syntax', rule, {
|
|
|
39
39
|
'&::first-line': {},
|
|
40
40
|
});
|
|
41
41
|
`,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
42
|
+
errors: [
|
|
43
|
+
{
|
|
44
|
+
messageId: 'no-legacy-pseudo-element-syntax',
|
|
45
|
+
line: 5,
|
|
46
|
+
column: 13,
|
|
47
|
+
endColumn: 19,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
messageId: 'no-legacy-pseudo-element-syntax',
|
|
51
|
+
line: 6,
|
|
52
|
+
column: 13,
|
|
53
|
+
endColumn: 20,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
messageId: 'no-legacy-pseudo-element-syntax',
|
|
57
|
+
line: 7,
|
|
58
|
+
column: 13,
|
|
59
|
+
endColumn: 26,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
messageId: 'no-legacy-pseudo-element-syntax',
|
|
63
|
+
line: 8,
|
|
64
|
+
column: 13,
|
|
65
|
+
endColumn: 24,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'single colon syntax in complex selector',
|
|
71
|
+
code: `
|
|
72
72
|
import { css } from '@compiled/react';
|
|
73
73
|
|
|
74
74
|
css({
|
|
75
75
|
'&:hover:after, &:active:before': {},
|
|
76
76
|
});
|
|
77
77
|
`,
|
|
78
|
-
|
|
78
|
+
output: `
|
|
79
79
|
import { css } from '@compiled/react';
|
|
80
80
|
|
|
81
81
|
css({
|
|
82
82
|
'&:hover::after, &:active::before': {},
|
|
83
83
|
});
|
|
84
84
|
`,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
85
|
+
errors: [
|
|
86
|
+
{
|
|
87
|
+
messageId: 'no-legacy-pseudo-element-syntax',
|
|
88
|
+
line: 5,
|
|
89
|
+
column: 19,
|
|
90
|
+
endColumn: 25,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
messageId: 'no-legacy-pseudo-element-syntax',
|
|
94
|
+
line: 5,
|
|
95
|
+
column: 35,
|
|
96
|
+
endColumn: 42,
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
101
|
});
|
|
@@ -2,20 +2,20 @@ import { tester } from '../../__tests__/utils/_tester';
|
|
|
2
2
|
import rule from '../index';
|
|
3
3
|
|
|
4
4
|
tester.run('no-restricted-at-rules', rule, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
valid: [
|
|
6
|
+
{
|
|
7
|
+
name: '@media',
|
|
8
|
+
code: `
|
|
9
9
|
import { css } from '@compiled/react';
|
|
10
10
|
|
|
11
11
|
css({
|
|
12
12
|
'@media screen and (min-width: 900px)': {}
|
|
13
13
|
});
|
|
14
14
|
`,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: '@media in cssMap',
|
|
18
|
+
code: `
|
|
19
19
|
import { cssMap } from '@compiled/react';
|
|
20
20
|
|
|
21
21
|
const myMap = cssMap({
|
|
@@ -30,40 +30,40 @@ tester.run('no-restricted-at-rules', rule, {
|
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
32
|
`,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'no space after rule name',
|
|
36
|
+
code: `
|
|
37
37
|
import { css } from '@compiled/react';
|
|
38
38
|
|
|
39
39
|
css({
|
|
40
40
|
'@supports(display: flex)': {}
|
|
41
41
|
});
|
|
42
42
|
`,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: '@supports',
|
|
46
|
+
code: `
|
|
47
47
|
import { css } from '@compiled/react';
|
|
48
48
|
|
|
49
49
|
css({
|
|
50
50
|
'@supports (display: flex)': {}
|
|
51
51
|
});
|
|
52
52
|
`,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: '@container',
|
|
56
|
+
code: `
|
|
57
57
|
import { css } from '@compiled/react';
|
|
58
58
|
|
|
59
59
|
css({
|
|
60
60
|
'@container (width > 400px)': {}
|
|
61
61
|
});
|
|
62
62
|
`,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: '@property',
|
|
66
|
+
code: `
|
|
67
67
|
import { css } from '@compiled/react';
|
|
68
68
|
|
|
69
69
|
css({
|
|
@@ -74,44 +74,44 @@ tester.run('no-restricted-at-rules', rule, {
|
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
`,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
invalid: [
|
|
80
|
+
{
|
|
81
|
+
name: '@color-profile',
|
|
82
|
+
code: `
|
|
83
83
|
import { css } from '@compiled/react';
|
|
84
84
|
|
|
85
85
|
css({
|
|
86
86
|
'@color-profile --swop5c': {}
|
|
87
87
|
});
|
|
88
88
|
`,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
89
|
+
errors: [
|
|
90
|
+
{
|
|
91
|
+
messageId: 'no-restricted-at-rules',
|
|
92
|
+
data: { atRule: '@color-profile' },
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: '@scope',
|
|
98
|
+
code: `
|
|
99
99
|
import { css } from '@compiled/react';
|
|
100
100
|
|
|
101
101
|
css({
|
|
102
102
|
'@scope (.article-body) to (figure)': {}
|
|
103
103
|
});
|
|
104
104
|
`,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
105
|
+
errors: [
|
|
106
|
+
{
|
|
107
|
+
messageId: 'no-restricted-at-rules',
|
|
108
|
+
data: { atRule: '@scope' },
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: '@scope in cssMap',
|
|
114
|
+
code: `
|
|
115
115
|
import { cssMap } from '@compiled/react';
|
|
116
116
|
|
|
117
117
|
cssMap({
|
|
@@ -120,12 +120,12 @@ tester.run('no-restricted-at-rules', rule, {
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
`,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
123
|
+
errors: [
|
|
124
|
+
{
|
|
125
|
+
messageId: 'no-restricted-at-rules',
|
|
126
|
+
data: { atRule: '@scope' },
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
131
|
});
|
|
@@ -2,131 +2,131 @@ import { tester } from '../../__tests__/utils/_tester';
|
|
|
2
2
|
import rule from '../index';
|
|
3
3
|
|
|
4
4
|
tester.run('no-restricted-pseudos', rule, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
valid: [
|
|
6
|
+
{
|
|
7
|
+
name: ':hover',
|
|
8
|
+
code: `
|
|
9
9
|
import { css } from '@compiled/react';
|
|
10
10
|
|
|
11
11
|
css({
|
|
12
12
|
'&:hover': {}
|
|
13
13
|
});
|
|
14
14
|
`,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: ':active',
|
|
18
|
+
code: `
|
|
19
19
|
import { css } from '@compiled/react';
|
|
20
20
|
|
|
21
21
|
css({
|
|
22
22
|
'&:active': {}
|
|
23
23
|
});
|
|
24
24
|
`,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
invalid: [
|
|
28
|
+
{
|
|
29
|
+
name: ':has()',
|
|
30
|
+
code: `
|
|
31
31
|
import { css } from '@compiled/react';
|
|
32
32
|
|
|
33
33
|
css({
|
|
34
34
|
'&:has(div)': {},
|
|
35
35
|
});
|
|
36
36
|
`,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
errors: [
|
|
38
|
+
{
|
|
39
|
+
messageId: 'no-restricted-pseudos',
|
|
40
|
+
line: 5,
|
|
41
|
+
column: 13,
|
|
42
|
+
endColumn: 17,
|
|
43
|
+
data: { pseudo: ':has' },
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: ':first-child',
|
|
49
|
+
code: `
|
|
50
50
|
import { css } from '@compiled/react';
|
|
51
51
|
|
|
52
52
|
css({
|
|
53
53
|
'&:first-child': {},
|
|
54
54
|
});
|
|
55
55
|
`,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
56
|
+
errors: [
|
|
57
|
+
{
|
|
58
|
+
messageId: 'no-restricted-pseudos',
|
|
59
|
+
line: 5,
|
|
60
|
+
column: 13,
|
|
61
|
+
endColumn: 25,
|
|
62
|
+
data: {
|
|
63
|
+
pseudo: ':first-child',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: ':first-of-type',
|
|
70
|
+
code: `
|
|
71
71
|
import { css } from '@compiled/react';
|
|
72
72
|
|
|
73
73
|
css({
|
|
74
74
|
'&:first-of-type': {},
|
|
75
75
|
});
|
|
76
76
|
`,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
77
|
+
errors: [
|
|
78
|
+
{
|
|
79
|
+
messageId: 'no-restricted-pseudos',
|
|
80
|
+
line: 5,
|
|
81
|
+
column: 13,
|
|
82
|
+
endColumn: 27,
|
|
83
|
+
data: {
|
|
84
|
+
pseudo: ':first-of-type',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: ':nth-child(2)',
|
|
91
|
+
code: `
|
|
92
92
|
import { css } from '@compiled/react';
|
|
93
93
|
|
|
94
94
|
css({
|
|
95
95
|
'&:nth-child(2)': {},
|
|
96
96
|
});
|
|
97
97
|
`,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
98
|
+
errors: [
|
|
99
|
+
{
|
|
100
|
+
messageId: 'no-restricted-pseudos',
|
|
101
|
+
line: 5,
|
|
102
|
+
column: 13,
|
|
103
|
+
endColumn: 23,
|
|
104
|
+
data: {
|
|
105
|
+
pseudo: ':nth-child',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'compound selector with child selectors',
|
|
112
|
+
code: `
|
|
113
113
|
import { css } from '@compiled/react';
|
|
114
114
|
|
|
115
115
|
css({
|
|
116
116
|
'&:hover:first-child:active': {},
|
|
117
117
|
});
|
|
118
118
|
`,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
119
|
+
errors: [
|
|
120
|
+
{
|
|
121
|
+
messageId: 'no-restricted-pseudos',
|
|
122
|
+
line: 5,
|
|
123
|
+
column: 19,
|
|
124
|
+
endColumn: 31,
|
|
125
|
+
data: {
|
|
126
|
+
pseudo: ':first-child',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
132
|
});
|
|
@@ -2,11 +2,11 @@ import { tester } from '../../__tests__/utils/_tester';
|
|
|
2
2
|
import rule from '../index';
|
|
3
3
|
|
|
4
4
|
tester.run('no-selectors-object', rule, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
valid: [],
|
|
6
|
+
invalid: [
|
|
7
|
+
{
|
|
8
|
+
name: 'selectors object is provided',
|
|
9
|
+
code: `
|
|
10
10
|
import { cssMap } from '@compiled/react';
|
|
11
11
|
|
|
12
12
|
cssMap({
|
|
@@ -15,11 +15,11 @@ tester.run('no-selectors-object', rule, {
|
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
`,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
errors: [
|
|
19
|
+
{
|
|
20
|
+
messageId: 'no-selectors-object',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
25
|
});
|
|
@@ -2,11 +2,11 @@ import { tester } from '../../__tests__/utils/_tester';
|
|
|
2
2
|
import rule from '../index';
|
|
3
3
|
|
|
4
4
|
tester.run('no-unparsable-selectors', rule, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
valid: [],
|
|
6
|
+
invalid: [
|
|
7
|
+
{
|
|
8
|
+
name: 'unparsable selectors',
|
|
9
|
+
code: `
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
11
|
|
|
12
12
|
css({
|
|
@@ -14,22 +14,22 @@ tester.run('no-unparsable-selectors', rule, {
|
|
|
14
14
|
':name:': {},
|
|
15
15
|
});
|
|
16
16
|
`,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
errors: [
|
|
18
|
+
{
|
|
19
|
+
messageId: 'no-unparsable-selectors',
|
|
20
|
+
data: { selectorText: '[&]' },
|
|
21
|
+
line: 5,
|
|
22
|
+
column: 11,
|
|
23
|
+
endColumn: 16,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
messageId: 'no-unparsable-selectors',
|
|
27
|
+
data: { selectorText: ':name:' },
|
|
28
|
+
line: 6,
|
|
29
|
+
column: 11,
|
|
30
|
+
endColumn: 19,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
35
|
});
|