some deletions
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / color-no-hex / index.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/stylelint/lib/rules/color-no-hex/index.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/stylelint/lib/rules/color-no-hex/index.js
deleted file mode 100644 (file)
index e08df87..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-"use strict";
-
-const report = require("../../utils/report");
-const ruleMessages = require("../../utils/ruleMessages");
-const styleSearch = require("style-search");
-const validateOptions = require("../../utils/validateOptions");
-
-const ruleName = "color-no-hex";
-
-const messages = ruleMessages(ruleName, {
-  rejected: hex => `Unexpected hex color "${hex}"`
-});
-
-const rule = function(actual) {
-  return (root, result) => {
-    const validOptions = validateOptions(result, ruleName, { actual });
-    if (!validOptions) {
-      return;
-    }
-
-    root.walkDecls(decl => {
-      const declString = decl.toString();
-
-      styleSearch({ source: declString, target: "#" }, match => {
-        // If there's not a colon, comma, or whitespace character before, we'll assume this is
-        // not intended to be a hex color, but is instead something like the
-        // hash in a url() argument
-        if (!/[:,\s]/.test(declString[match.startIndex - 1])) {
-          return;
-        }
-
-        const hexMatch = /^#[0-9A-Za-z]+/.exec(
-          declString.substr(match.startIndex)
-        );
-        if (!hexMatch) {
-          return;
-        }
-        const hexValue = hexMatch[0];
-
-        report({
-          message: messages.rejected(hexValue),
-          node: decl,
-          index: match.startIndex,
-          result,
-          ruleName
-        });
-      });
-    });
-  };
-};
-
-rule.ruleName = ruleName;
-rule.messages = messages;
-module.exports = rule;