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'});
Copy file name to clipboardExpand all lines: test.js
+53Lines changed: 53 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,59 @@ test(name, function (t) {
104
104
});
105
105
});
106
106
107
+
108
+
varerrorTests=[
109
+
{
110
+
should: 'reject naked element selectors',
111
+
input: 'input {}',
112
+
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"'
113
+
},
114
+
{
115
+
should: 'reject naked element selectors in a collection',
116
+
input: '.foo, input {}',
117
+
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"'
118
+
},
119
+
{
120
+
should: 'reject naked psuedo classes',
121
+
input: ':focus {}',
122
+
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"'
123
+
},
124
+
{
125
+
should: 'reject naked psuedo classes in a collection',
126
+
input: '.foo, :focus {}',
127
+
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"'
128
+
},
129
+
{
130
+
should: 'reject naked attribute selectors',
131
+
input: '[data-foobar] {}',
132
+
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]"'
133
+
},
134
+
{
135
+
should: 'reject naked attribute selectors in a collection',
136
+
input: '.foo, [data-foobar] {}',
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 [data-foobar]"'
0 commit comments