From 9594c338d9f087ab71f4d18e82eca7aa583b9350 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Fri, 30 Aug 2024 18:05:00 +0200 Subject: [PATCH] Add an ignore list containing globs to the configuration file --- README.md | 9 ++++++++- bin/cli.js | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bcb4de3..8184f44 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,10 @@ export default { // config for the rule `icon-precision` of the external // hypotetical npm package `simple-icons-svglint-rules` } - } + }, + ignore: [ + 'glob/to/files/to/ignores/**', + ] } ``` @@ -253,4 +256,8 @@ export default { } ``` +### `ignore` + +It's an optional array of strings containing glob for files to ignore. + [selecting-elements-cheerio]: https://cheerio.js.org/docs/basics/selecting diff --git a/bin/cli.js b/bin/cli.js index 84de543..d948730 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -139,7 +139,9 @@ process.on('exit', () => { } else { // Lint all the CLI specified files const files = cli.input - .flatMap((v) => glob.sync(v)) + .flatMap((v) => glob.sync(v, { + ignore: configObject.ignore || [], + })) .map((v) => path.resolve(process.cwd(), v)); // Keep track so we know when every linting has finished let hasErrors = false;