Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const validOptions = validateOptions(result, ruleName, { actual: on }, {
optional: true,
actual: options,
possible: {
browsers: [isString],
},
})
if (!validOptions) { return }
const stylehacksOptions = { lint: true }
if (options && options.browsers) {
stylehacksOptions.browsers = options.browsers
}
const stylehacksResult = new Result()
stylehacks(stylehacksOptions)(root, stylehacksResult)
stylehacksResult.warnings().forEach(stylehacksWarning => {
const message = messages.rejected(stylehacksWarning.identifier, stylehacksWarning.hack)
report({
ruleName,
result,
message,
node: stylehacksWarning.node,
line: stylehacksWarning.line,
column: stylehacksWarning.column,
})
})
}
}