Comparing version 1.0.1 to 1.0.2
@@ -15,2 +15,3 @@ #!/usr/bin/env node | ||
const chalk = require("chalk"); | ||
const glob = require("glob"); | ||
@@ -24,5 +25,2 @@ const logger = Logger(""); | ||
}); | ||
process.on("exit", () => { | ||
GUI.finish(); | ||
}); | ||
@@ -36,3 +34,3 @@ // Generates the CLI binding using meow | ||
${chalk.bold("svglint")} [--config config.js] [--ci] [--debug] ${chalk.bold("file1.svg file2.svg")} | ||
${chalk.yellow("Options:")} | ||
@@ -51,2 +49,6 @@ ${chalk.bold("--help")} Display this help text | ||
process.on("exit", () => { | ||
GUI.finish(); | ||
}); | ||
/** CLI main function */ | ||
@@ -58,3 +60,5 @@ (async function(){ | ||
GUI.setCI(cli.flags.ci); | ||
const files = cli.input.map(v => path.resolve(process.cwd(), v)); | ||
const files = cli.input.map(v => glob.sync(v)) | ||
.reduce((a, v) => a.concat(v), []) | ||
.map(v => path.resolve(process.cwd(), v)); | ||
@@ -61,0 +65,0 @@ // load the config |
{ | ||
"name": "svglint", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Linter for SVGs", | ||
@@ -26,2 +26,3 @@ "main": "src/svglint.js", | ||
"cheerio": "^1.0.0-rc.2", | ||
"glob": "^7.1.2", | ||
"htmlparser2": "^3.9.1", | ||
@@ -28,0 +29,0 @@ "log-update": "^2.3.0", |
@@ -99,8 +99,10 @@ /** | ||
); | ||
outp.push( | ||
"", | ||
this.$titles.lints, | ||
$lintings | ||
.join("\n"), | ||
); | ||
if ($lintings.length) { | ||
outp.push( | ||
"", | ||
this.$titles.lints, | ||
$lintings | ||
.join("\n"), | ||
); | ||
} | ||
} | ||
@@ -107,0 +109,0 @@ outp.push( |
@@ -144,2 +144,21 @@ const chalk = require("chalk"); | ||
it("should succeed with a valid value when given regex", function(){ | ||
return testSucceeds({ | ||
"role": /^im.$/, | ||
"rule::selector": "svg", | ||
}); | ||
}); | ||
it("should fail with an invalid value when given regex", function(){ | ||
return testFails({ | ||
"role": /^.im$/, | ||
"rule::selector": "svg", | ||
}); | ||
}); | ||
it("should fail with a non-existant attribute when given regex", function(){ | ||
return testFails({ | ||
"foo": /^img$/, | ||
"rule::selector": "svg", | ||
}); | ||
}); | ||
it("should default to wildcard selector", function(){ | ||
@@ -146,0 +165,0 @@ return testFails({ |
110124
2237
8
+ Addedglob@^7.1.2
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedwrappy@1.0.2(transitive)