standard-json
Advanced tools
Comparing version 1.0.3 to 1.1.0
@@ -10,3 +10,3 @@ #!/usr/bin/env node | ||
var concatStream = concat({encoding: 'string'}, function (data) { | ||
var concatStream = concat({ encoding: 'string' }, function (data) { | ||
var output = makeJson(data) | ||
@@ -13,0 +13,0 @@ process.exitCode = output.length ? 1 : 0 |
17
index.js
module.exports = jsonify | ||
function jsonify (rawtext, opts) { | ||
opts = opts || {noisey: false} | ||
opts = opts || { noisey: false } | ||
var lines = rawtext.split('\n') | ||
@@ -11,6 +11,7 @@ if (lines[lines.length - 1] === '') lines.pop() | ||
lines.forEach(function (line) { | ||
var re = /\s*([^:]+):([^:]+):([^:]+): (.*?)( \((.*)\))?$/.exec(line) | ||
var re = /\s*([A-Za-z]:)?([^:]+):([^:]+):([^:]+): (.*?)( \((.*)\))?$/.exec(line) | ||
if (!re) return opts.noisey ? console.error(line) : null | ||
if (re[1] === undefined) re[1] = '' | ||
var filePath = re[1] | ||
var filePath = re[1] + re[2] | ||
@@ -20,3 +21,3 @@ var result = resultMap[filePath] | ||
result = resultMap[filePath] = { | ||
filePath: re[1], | ||
filePath: re[1] + re[2], | ||
messages: [] | ||
@@ -28,6 +29,6 @@ } | ||
result.messages.push({ | ||
line: re[2], | ||
column: re[3], | ||
message: re[4].trim(), | ||
ruleId: re[6] | ||
line: re[3], | ||
column: re[4], | ||
message: re[5].trim(), | ||
ruleId: re[7] | ||
}) | ||
@@ -34,0 +35,0 @@ }) |
{ | ||
"name": "standard-json", | ||
"description": "Format JavaScript Standard Style output to a JSON array.", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"author": "Dan Flettre <fletd01@yahoo.com>", | ||
@@ -12,5 +12,8 @@ "bin": { | ||
}, | ||
"dependencies": { | ||
"concat-stream": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"minicat": "^1.0.0", | ||
"standard": "*", | ||
"tap-spec": "^4.0.2", | ||
"tape": "^4.0.0" | ||
@@ -33,7 +36,4 @@ }, | ||
"scripts": { | ||
"test": "standard && tape test/*.js | tap-spec" | ||
}, | ||
"dependencies": { | ||
"concat-stream": "^1.5.0" | ||
"test": "standard && tape test/*.js" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5932
45
+ Addedconcat-stream@2.0.0(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
- Removedconcat-stream@1.6.2(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedisarray@1.0.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
Updatedconcat-stream@^2.0.0