Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an ignore list containing globs to the configuration file #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 3 additions & 1 deletion bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down