Created
March 19, 2019 13:34
-
-
Save jamesridgway/897582b099f43a1b9c538bb04969d89f to your computer and use it in GitHub Desktop.
Calculate total number of errors and warnings from an eslint json output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jq 'def sum(f): reduce .[] as $row (0; . + ($row|f) );[.[] | {"errorCount": .errorCount, "warningCount": .warningCount}] | . as $in | reduce (.[0] | keys)[] as $key ( {}; . + {($key): ($in | sum(.[$key]))})' eslint.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment