CLI.getValidator()
Extends CLI
class with getValidator
to get a preconfigured HtmlValidate
instance with options from cli-tools. Currently only config
and rules
is supported but more will be added over time.
The two main motivations:
- Makes it easier to write other tooling exposing a similar CLI experience, e.g. vue-cli-plugin-html-validate.
- By shifting code into
CLI
the code becomes easier to test as it isn't dependent on modifyingprocess.argv
.
Related to vue-cli-plugin-html-validate#1
Checklist
-
Documentation updated -
Change covered by a testcase -
Commit history cleaned (no WIP, fixups, etc)
Edited by David Sveningsson