From ce99800f0f355f01e975a94d04c8f0fa4401320f Mon Sep 17 00:00:00 2001 From: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com> Date: Wed, 10 Feb 2021 16:04:03 +0300 Subject: Migrate Husky To v5 Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com> --- .config/eslint/annotations_formatter.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .config/eslint/annotations_formatter.js (limited to '.config/eslint/annotations_formatter.js') diff --git a/.config/eslint/annotations_formatter.js b/.config/eslint/annotations_formatter.js new file mode 100644 index 0000000..b3a421d --- /dev/null +++ b/.config/eslint/annotations_formatter.js @@ -0,0 +1,14 @@ +module.exports = function (results) { + let output = ""; + + for (const file of results.filter(r => r.messages.length > 0)) { + for (const message of file.messages) { + const path = file.filePath.substr(process.cwd().length + 1); + const severity = message.fatal || message.severity === 2 ? "error" : "warning"; + const text = `[ESLint] ${message.ruleId}: ${message.message}`; + output += `::${severity} file=${path},line=${message.line},col=${message.column}::${text}\n`; + } + } + + return output; +}; -- cgit v1.2.3