Comparing version 3.0.0 to 3.1.0
@@ -17,4 +17,2 @@ #!/usr/bin/env node | ||
const gui = new GUI(); | ||
const logger = logging(''); | ||
@@ -50,3 +48,3 @@ | ||
${chalk.bold('svglint')} [--config config.js] [--ci] [--debug] ${chalk.bold('file1.svg file2.svg')} | ||
${chalk.bold('svglint')} --stdin [--config config.js] [--ci] [--debug] < ${chalk.bold('file1.svg')} | ||
${chalk.bold('svglint')} --stdin [--config config.js] [--no-summary] [--ci] [--debug] < ${chalk.bold('file1.svg')} | ||
@@ -59,3 +57,4 @@ ${chalk.yellow('Options:')} | ||
${chalk.bold('--ci, -C')} Only output to stdout once, when linting is finished | ||
${chalk.bold('--stdin')} Read an SVG from stdin`, | ||
${chalk.bold('--stdin')} Read an SVG from stdin | ||
${chalk.bold('--summary')} Print the summary at the end (default)`, | ||
{ | ||
@@ -68,2 +67,3 @@ importMeta: import.meta, | ||
stdin: {type: 'boolean'}, | ||
summary: {type: 'boolean', default: true}, | ||
}, | ||
@@ -73,2 +73,4 @@ }, | ||
const gui = new GUI({printSummary: cli.flags.summary}); | ||
process.on('exit', () => { | ||
@@ -147,3 +149,7 @@ gui.finish(); | ||
const files = cli.input | ||
.flatMap((v) => glob.sync(v)) | ||
.flatMap((v) => | ||
glob.sync(v, { | ||
ignore: configObject.ignore || [], | ||
}), | ||
) | ||
.map((v) => path.resolve(process.cwd(), v)); | ||
@@ -150,0 +156,0 @@ // Keep track so we know when every linting has finished |
{ | ||
"name": "svglint", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Linter for SVGs", | ||
@@ -50,3 +50,3 @@ "type": "module", | ||
"devDependencies": { | ||
"@rollup/plugin-dynamic-import-vars": "^1.4.1", | ||
"@rollup/plugin-dynamic-import-vars": "^2.1.3", | ||
"@semantic-release/git": "9.0.1", | ||
@@ -58,3 +58,3 @@ "commitizen": "^4.2.4", | ||
"mocha": "^9.1.3", | ||
"rollup": "^2.61.1", | ||
"rollup": "^4.22.4", | ||
"xo": "^0.58.0" | ||
@@ -61,0 +61,0 @@ }, |
@@ -107,3 +107,6 @@ # SVGLint | ||
} | ||
} | ||
}, | ||
ignore: [ | ||
'glob/to/files/to/ignores/**', | ||
] | ||
} | ||
@@ -257,2 +260,6 @@ ``` | ||
### `ignore` | ||
It's an optional array of strings containing glob for files to ignore. | ||
[selecting-elements-cheerio]: https://cheerio.js.org/docs/basics/selecting |
@@ -18,3 +18,3 @@ /** | ||
export default class GUI { | ||
constructor() { | ||
constructor({printSummary = true} = {}) { | ||
// Subscribe to global logs | ||
@@ -34,3 +34,3 @@ Logger.setCLI(true); | ||
this.$log = new Log(logHistory); | ||
this.$summary = new Summary(); | ||
this.$summary = printSummary ? new Summary() : null; | ||
/** @type {LintingDisplay[]} */ | ||
@@ -45,4 +45,7 @@ this.$lintings = []; | ||
if (this.ci) { | ||
// eslint-disable-next-line no-console | ||
console.log(this.render()); | ||
const output = this.render(); | ||
if (output) { | ||
// eslint-disable-next-line no-console | ||
console.log(output); | ||
} | ||
} else { | ||
@@ -110,3 +113,6 @@ this.update(true); | ||
outp.push('', this.$titles.summary, this.$summary); | ||
if (this.$summary) { | ||
outp.push('', this.$titles.summary, this.$summary); | ||
} | ||
if (outp[0] === '') { | ||
@@ -134,3 +140,6 @@ outp.shift(); | ||
this.$lintings.push(new LintingDisplay(linting)); | ||
this.$summary.addLinting(linting); | ||
if (this.$summary) { | ||
this.$summary.addLinting(linting); | ||
} | ||
linting.on('rule', () => this.update()); | ||
@@ -137,0 +146,0 @@ linting.on('done', () => this.update()); |
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
3232
264
160880
4