.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / selectorListCommaWhitespaceChecker.js
1 "use strict";
2
3 const isStandardSyntaxRule = require("../utils/isStandardSyntaxRule");
4 const report = require("../utils/report");
5 const styleSearch = require("style-search");
6
7 module.exports = function(opts) {
8   opts.root.walkRules(rule => {
9     if (!isStandardSyntaxRule(rule)) {
10       return;
11     }
12     const selector = rule.selector;
13     styleSearch(
14       {
15         source: selector,
16         target: ",",
17         functionArguments: "skip"
18       },
19       match => {
20         checkDelimiter(selector, match.startIndex, rule);
21       }
22     );
23   });
24
25   function checkDelimiter(source, index, node) {
26     opts.locationChecker({
27       source,
28       index,
29       err: m =>
30         report({
31           message: m,
32           node,
33           index,
34           result: opts.result,
35           ruleName: opts.checkedRuleName
36         })
37     });
38   }
39 };