.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / mediaQueryListCommaWhitespaceChecker.js
1 "use strict";
2
3 const atRuleParamIndex = require("../utils/atRuleParamIndex");
4 const report = require("../utils/report");
5 const styleSearch = require("style-search");
6
7 module.exports = function(opts) {
8   opts.root.walkAtRules(/^media$/i, atRule => {
9     const params = atRule.params;
10     styleSearch({ source: params, target: "," }, match => {
11       checkComma(params, match.startIndex, atRule);
12     });
13   });
14
15   function checkComma(source, index, node) {
16     opts.locationChecker({
17       source,
18       index,
19       err: m =>
20         report({
21           message: m,
22           node,
23           index: index + atRuleParamIndex(node),
24           result: opts.result,
25           ruleName: opts.checkedRuleName
26         })
27     });
28   }
29 };