Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/fourtyone11/origin-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'assets/node_modules/stylelint/lib/formatters/disableOptionsReportStringFormatter.js')
-rw-r--r--assets/node_modules/stylelint/lib/formatters/disableOptionsReportStringFormatter.js49
1 files changed, 49 insertions, 0 deletions
diff --git a/assets/node_modules/stylelint/lib/formatters/disableOptionsReportStringFormatter.js b/assets/node_modules/stylelint/lib/formatters/disableOptionsReportStringFormatter.js
new file mode 100644
index 0000000..8e3f9a9
--- /dev/null
+++ b/assets/node_modules/stylelint/lib/formatters/disableOptionsReportStringFormatter.js
@@ -0,0 +1,49 @@
+'use strict';
+
+const chalk = require('chalk');
+const path = require('path');
+
+/**
+ * @param {string} fromValue
+ * @return {string}
+ */
+function logFrom(fromValue) {
+ if (fromValue.startsWith('<')) return fromValue;
+
+ return path
+ .relative(process.cwd(), fromValue)
+ .split(path.sep)
+ .join('/');
+}
+
+/**
+ * @param {import('stylelint').StylelintDisableOptionsReport} report
+ * @returns {string}
+ */
+module.exports = function(report) {
+ if (!report) return '';
+
+ let output = '';
+
+ report.forEach((sourceReport) => {
+ if (!sourceReport.ranges || sourceReport.ranges.length === 0) {
+ return;
+ }
+
+ output += '\n';
+ // eslint-disable-next-line prefer-template
+ output += chalk.underline(logFrom(sourceReport.source || '')) + '\n';
+
+ sourceReport.ranges.forEach((range) => {
+ output += `unused rule: ${range.unusedRule}, start line: ${range.start}`;
+
+ if (range.end !== undefined) {
+ output += `, end line: ${range.end}`;
+ }
+
+ output += '\n';
+ });
+ });
+
+ return output;
+};