diff options
| author | 2021-03-07 18:48:43 +0200 | |
|---|---|---|
| committer | 2021-03-07 18:48:43 +0200 | |
| commit | 11151894702fab1a06e3dfe9eca43d4596b5290e (patch) | |
| tree | c74483bd5327751ef54a486d7bdcf20eed418919 /.config/eslint/annotations_formatter.js | |
| parent | Add margin to bottom of captcha (diff) | |
| parent | Renables OAuth Button On Failure (diff) | |
Merge branch 'main' into hcaptcha
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; +}; | 
