You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throwrule.error('Global selector detected in local context. Does this selector really need to be global? If so, you need to explicitly export it into the global scope with ":global", e.g. ":global '+trimmedSelector+'"',{plugin: 'postcss-modules-local-by-default'});
Copy file name to clipboardExpand all lines: test.js
-87Lines changed: 0 additions & 87 deletions
Original file line number
Diff line number
Diff line change
@@ -88,41 +88,6 @@ var tests = [
88
88
should: 'ignore psuedo elements that are already local',
89
89
input: ':local(.foo):after {}',
90
90
expected: ':local(.foo):after {}'
91
-
},
92
-
{
93
-
should: 'convert nested selectors that are already local using the old syntax into the new local syntax',
94
-
input: '.local[foo] .local[bar] {}',
95
-
expected: ':local(.foo) :local(.bar) {}'
96
-
},
97
-
{
98
-
should: 'convert multiple selectors that are already local using the old syntax into the new local syntax',
99
-
input: '.local[foo], .local[bar] {}',
100
-
expected: ':local(.foo), :local(.bar) {}'
101
-
},
102
-
{
103
-
should: 'convert sibling selectors that are already local using the old syntax into the new local syntax',
104
-
input: '.local[foo] ~ .local[bar] {}',
105
-
expected: ':local(.foo) ~ :local(.bar) {}'
106
-
},
107
-
{
108
-
should: 'convert psuedo elements that are already local using the old syntax into the new local syntax',
109
-
input: '.local[foo]:after {}',
110
-
expected: ':local(.foo):after {}'
111
-
},
112
-
{
113
-
should: 'not reject non-global element selectors when lint mode is not enabled',
114
-
input: 'input {}',
115
-
expected: 'input {}'
116
-
},
117
-
{
118
-
should: 'support :extends',
119
-
input: '.foo:extends(.className) {}',
120
-
expected: ':local(.foo):extends(.className) {}'
121
-
},
122
-
{
123
-
should: 'support imported :extends',
124
-
input: '.foo:extends(.button from "library/button.css") {}',
125
-
expected: ':local(.foo):extends(.button from "library/button.css") {}'
126
91
}
127
92
];
128
93
@@ -140,58 +105,6 @@ test(name, function (t) {
140
105
});
141
106
142
107
143
-
varerrorTests=[
144
-
{
145
-
should: 'reject non-global element selectors',
146
-
input: 'input {}',
147
-
reason: 'Global selector detected in local context. Does this selector really need to be global? If so, you need to explicitly export it into the global scope with ":global", e.g. ":global input"'
148
-
},
149
-
{
150
-
should: 'reject non-global element selectors in a collection',
151
-
input: '.foo, input {}',
152
-
reason: 'Global selector detected in local context. Does this selector really need to be global? If so, you need to explicitly export it into the global scope with ":global", e.g. ":global input"'
153
-
},
154
-
{
155
-
should: 'reject non-global psuedo classes',
156
-
input: ':focus {}',
157
-
reason: 'Global selector detected in local context. Does this selector really need to be global? If so, you need to explicitly export it into the global scope with ":global", e.g. ":global :focus"'
158
-
},
159
-
{
160
-
should: 'reject non-global psuedo classes in a collection',
161
-
input: '.foo, :focus {}',
162
-
reason: 'Global selector detected in local context. Does this selector really need to be global? If so, you need to explicitly export it into the global scope with ":global", e.g. ":global :focus"'
163
-
},
164
-
{
165
-
should: 'reject non-global attribute selectors',
166
-
input: '[data-foobar] {}',
167
-
reason: 'Global selector detected in local context. Does this selector really need to be global? If so, you need to explicitly export it into the global scope with ":global", e.g. ":global [data-foobar]"'
168
-
},
169
-
{
170
-
should: 'reject non-global attribute selectors in a collection',
171
-
input: '.foo, [data-foobar] {}',
172
-
reason: 'Global selector detected in local context. Does this selector really need to be global? If so, you need to explicitly export it into the global scope with ":global", e.g. ":global [data-foobar]"'
0 commit comments