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-local-scope'});
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-local-scope'});
Copy file name to clipboardExpand all lines: test.js
+13-8Lines changed: 13 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,12 @@ var tests = [
108
108
should: 'convert psuedo elements that are already local using the old syntax into the new local syntax',
109
109
input: '.local[foo]:after {}',
110
110
expected: ':local(.foo):after {}'
111
-
}
111
+
},
112
+
{
113
+
should: 'not reject non-global element selectors when lint mode is not enabled',
114
+
input: 'input {}',
115
+
expected: 'input {}'
116
+
},
112
117
];
113
118
114
119
functionprocess(css,options){
@@ -127,32 +132,32 @@ test(name, function (t) {
127
132
128
133
varerrorTests=[
129
134
{
130
-
should: 'reject naked element selectors',
135
+
should: 'reject non-global element selectors',
131
136
input: 'input {}',
132
137
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"'
133
138
},
134
139
{
135
-
should: 'reject naked element selectors in a collection',
140
+
should: 'reject non-global element selectors in a collection',
136
141
input: '.foo, input {}',
137
142
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"'
138
143
},
139
144
{
140
-
should: 'reject naked psuedo classes',
145
+
should: 'reject non-global psuedo classes',
141
146
input: ':focus {}',
142
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 :focus"'
143
148
},
144
149
{
145
-
should: 'reject naked psuedo classes in a collection',
150
+
should: 'reject non-global psuedo classes in a collection',
146
151
input: '.foo, :focus {}',
147
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 :focus"'
148
153
},
149
154
{
150
-
should: 'reject naked attribute selectors',
155
+
should: 'reject non-global attribute selectors',
151
156
input: '[data-foobar] {}',
152
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 [data-foobar]"'
153
158
},
154
159
{
155
-
should: 'reject naked attribute selectors in a collection',
160
+
should: 'reject non-global attribute selectors in a collection',
156
161
input: '.foo, [data-foobar] {}',
157
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 [data-foobar]"'
0 commit comments