1
0
mirror of https://github.com/thangisme/notes.git synced 2024-06-28 15:35:29 +00:00
notes/node_modules/stylelint/lib/rules/mediaQueryListCommaWhitespaceChecker.js

26 lines
670 B
JavaScript
Raw Normal View History

2017-03-09 18:16:08 +00:00
"use strict"
const atRuleParamIndex = require("../utils/atRuleParamIndex")
const report = require("../utils/report")
const styleSearch = require("style-search")
module.exports = function (opts) {
opts.root.walkAtRules(/^media$/i, atRule => {
const params = atRule.params
styleSearch({ source: params, target: "," }, match => {
checkComma(params, match.startIndex, atRule)
})
})
function checkComma(source, index, node) {
opts.locationChecker({ source, index, err: m => report({
message: m,
node,
index: index + atRuleParamIndex(node),
result: opts.result,
ruleName: opts.checkedRuleName,
}),
})
}
}