Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
// Selector
if (item.selector !== undefined) {
results = results.concat(findInterpolation(item.selector));
}
if (item.type === "atrule") {
// @forward and @use
if (item.name === "forward" || item.name === "use") {
return;
}
// Media queries
if (item.name === "media" || item.name === "import") {
mediaQueryParser(item.params).walk(node => {
const type = node.type;
if (["keyword", "media-type", "media-feature"].includes(type)) {
results = results.concat(
findInterpolation(
node.value,
atRuleParamIndex(item) + node.sourceIndex
)
);
} else if (["value", "url"].includes(type)) {
results.push({
source: node.value,
operators: findOperators({
string: node.value,
globalIndex: atRuleParamIndex(item) + node.sourceIndex,
isAfterColon: true
root.walkAtRules(/^media$/i, atRule => {
mediaParser(atRule.params).walk(/^media-feature$/i, mediaFeatureNode => {
const { parent, sourceIndex, value } = mediaFeatureNode
if (isRangeContextMediaFeature(parent.value)
|| !isStandardSyntaxMediaFeatureName(value)
|| isCustomMediaQuery(value)
) { return }
const expectedFeatureName = expectation === "lower"
? value.toLowerCase()
: value.toUpperCase()
if (value === expectedFeatureName) { return }
report({
index: atRuleParamIndex(atRule) + sourceIndex,
message: messages.expected(value, expectedFeatureName),
root.walkAtRules(/^media$/i, atRule => {
mediaParser(atRule.params).walk(/^media-feature$/i, mediaFeatureNode => {
const { parent, sourceIndex, value } = mediaFeatureNode
if (isRangeContextMediaFeature(parent.value)
|| !isStandardSyntaxMediaFeatureName(value)
|| isCustomMediaQuery(value)
) { return }
if (optionsMatches(options, "ignoreMediaFeatureNames", value)) { return }
if (vendor.prefix(value) || mediaFeatureNames.has(value.toLowerCase())) { return }
report({
index: atRuleParamIndex(atRule) + sourceIndex,
message: messages.rejected(value),
node: atRule,
ruleName,