diff options
| author | 2021-03-06 19:17:37 +0000 | |
|---|---|---|
| committer | 2021-03-06 19:17:37 +0000 | |
| commit | 376520dea9180554d59903d167579fa115e49dad (patch) | |
| tree | 16e9843395c28806ed9aa9f93eebe25951ac22f6 /.config/eslint/annotations_formatter.js | |
| parent | Merge pull request #167 from python-discord/dependabot/npm_and_yarn/typescrip... (diff) | |
| parent | Set pre-commit to be executable (diff) | |
Merge pull request #134 from python-discord/dependabot/npm_and_yarn/husky-5.0.9
Diffstat (limited to '.config/eslint/annotations_formatter.js')
| -rw-r--r-- | .config/eslint/annotations_formatter.js | 14 |
1 files changed, 14 insertions, 0 deletions
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; +}; |