.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / mediaFeatureColonSpaceChecker.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
11     styleSearch({ source: params, target: ":" }, match => {
12       checkColon(params, match.startIndex, atRule);
13     });
14   });
15
16   function checkColon(source, index, node) {
17     opts.locationChecker({
18       source,
19       index,
20       err: m =>
21         report({
22           message: m,
23           node,
24           index: index + atRuleParamIndex(node),
25           result: opts.result,
26           ruleName: opts.checkedRuleName
27         })
28     });
29   }
30 };