Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
root.walkRules(rule => {
let selector = null;
if (!isStandardSyntaxRule(rule)) {
return;
}
selector = rule.selector;
if (!selector) {
return;
}
const isRejected = rule.nodes.some(o => {
return (
o.type === 'decl' &&
o.prop.toLowerCase() === 'font-size' &&
(checkInPx(o.value) || checkInPt(o.value))
);
});
export default function(rule) {
return isStandardSyntaxRule(rule);
}
root.walk(node => {
let selector = null;
if (node.type === 'rule') {
if (!isStandardSyntaxRule(node)) {
return;
}
selector = node.selector;
} else if (node.type === 'atrule' && node.name.toLowerCase() === 'page' && node.params) {
selector = node.params;
}
if (!selector) {
return;
}
const isAccepted = check(node);
if (!isAccepted) {
utils.report({
index: node.lastEach,
root.walk(node => {
let selector = null;
if (node.type === 'rule') {
if (!isStandardSyntaxRule(node)) {
return;
}
selector = node.selector;
} else if (node.type === 'atrule' && node.name.toLowerCase() === 'page' && node.params) {
selector = node.params;
}
if (!selector) {
return;
}
const isAccepted = check(node);
if (!isAccepted) {
utils.report({
index: node.lastEach,
root.walk(node => {
let selector = null;
if (node.type === 'rule') {
if (!isStandardSyntaxRule(node)) {
return;
}
selector = node.selector;
} else if (node.type === 'atrule' && node.name.toLowerCase() === 'page' && node.params) {
selector = node.params;
}
if (!selector) {
return;
}
const isAccepted = check(selector, node);
if (!isAccepted) {
utils.report({
index: node.lastEach,
root.walk(node => {
let selector = null;
if (node.type === 'rule') {
if (!isStandardSyntaxRule(node)) {
return;
}
selector = node.selector;
} else if (node.type === 'atrule' && node.name.toLowerCase() === 'page' && node.params) {
selector = node.params;
}
if (!selector) {
return;
}
const isAccepted = check(node);
if (!isAccepted) {
utils.report({
index: node.lastEach,
root.walk(node => {
let selector = null;
if (node.type === 'rule') {
if (!isStandardSyntaxRule(node)) {
return;
}
selector = node.selector;
} else if (node.type === 'atrule' && node.name === 'page' && node.params) {
if (!isStandardSyntaxAtRule(node)) {
return;
}
selector = node.params;
}
if (!selector) {
return;
}
root.walk(node => {
let selector = null;
if (node.type === 'rule') {
if (!isStandardSyntaxRule(node)) {
return;
}
selector = node.selector;
} else if (node.type === 'atrule' && node.name.toLowerCase() === 'page' && node.params) {
selector = node.params;
}
if (!selector) {
return;
}
const isAccepted = check(selector, node);
if (!isAccepted) {
utils.report({
index: node.lastEach,
root.walkRules(rule => {
let selector = null;
if (!isStandardSyntaxRule(rule)) {
return;
}
selector = rule.selector;
if (!selector) {
return;
}
const isRejected =
nodesProbablyForText(rule.nodes) &&
rule.nodes.some(o => {
return (
o.type === 'decl' &&
o.prop.toLowerCase() === 'max-width' &&
o.value.toLowerCase().endsWith('ch') &&
(parseFloat(o.value) < 45 || parseFloat(o.value) > 80)
root.walkRules(rule => {
let selector = null;
if (!isStandardSyntaxRule(rule)) {
return;
}
selector = rule.selector;
if (!selector) {
return;
}
if (selector.indexOf(':') === -1) {
return;
}
if (selector.indexOf(':hover') === -1) {
return;
}