Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return (root, result) => {
const validOptions = utils.validateOptions(result, ruleName, { actual: options });
if (!validOptions) {
return;
}
utils.checkAgainstRule({
ruleName: "at-rule-empty-line-before",
ruleSettings: ["always"],
root,
}, warning => {
utils.report({
ruleName,
result,
message: messages.warning(warning),
node: root,
index: 1,
word: "foo",
line: 2,
});
});
};
};
},
optional: true
}
);
if (!validOptions) {
return;
}
const optionsAtRules = secondaryOptions && secondaryOptions.ignoreAtRules;
const ignoreAtRules = sassAtRules.concat(optionsAtRules || []);
const defaultedOptions = Object.assign({}, secondaryOptions, {
ignoreAtRules
});
utils.checkAgainstRule(
{
ruleName: ruleToCheckAgainst,
ruleSettings: [primaryOption, defaultedOptions],
root
},
warning => {
const name = warning.node.name;
if (!ignoreAtRules.includes(name)) {
utils.report({
message: messages.rejected(`@${name}`),
ruleName,
result,
node: warning.node,
line: warning.line,
column: warning.column