Skip to content

Commit

Permalink
feat: add an ignore list containing globs to the configuration file (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
calixteman authored Nov 17, 2024
1 parent 03c8697 commit 0b64bce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/**',
]
}
```

Expand Down Expand Up @@ -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
6 changes: 5 additions & 1 deletion bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ 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;
Expand Down

0 comments on commit 0b64bce

Please sign in to comment.