Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / formatters / needlessDisablesStringFormatter.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/stylelint/lib/formatters/needlessDisablesStringFormatter.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/stylelint/lib/formatters/needlessDisablesStringFormatter.js
new file mode 100644 (file)
index 0000000..cb326c3
--- /dev/null
@@ -0,0 +1,33 @@
+"use strict";
+
+const chalk = require("chalk");
+const path = require("path");
+
+function logFrom(fromValue) {
+  if (fromValue.charAt(0) === "<") return fromValue;
+  return path
+    .relative(process.cwd(), fromValue)
+    .split(path.sep)
+    .join("/");
+}
+
+module.exports = function(report) {
+  let output = "";
+
+  report.forEach(sourceReport => {
+    if (!sourceReport.ranges || sourceReport.ranges.length === 0) {
+      return;
+    }
+    output += "\n";
+    output += chalk.underline(logFrom(sourceReport.source)) + "\n";
+    sourceReport.ranges.forEach(range => {
+      output += `start: ${range.start}`;
+      if (range.end !== undefined) {
+        output += `, end: ${range.end}`;
+      }
+      output += "\n";
+    });
+  });
+
+  return output;
+};