Commit 536be697 authored by David Sveningsson's avatar David Sveningsson

feat(api): new method `validateMultipleFiles`

parent eb0111f1
......@@ -3,7 +3,7 @@ import { Source } from "./context";
import { SourceHooks } from "./context/source";
import { Engine, EventDump, TokenDump } from "./engine";
import { Parser } from "./parser";
import { Report } from "./reporter";
import { Report, Reporter } from "./reporter";
import { RuleDocumentation } from "./rule";
/**
......@@ -72,6 +72,19 @@ class HtmlValidate {
return engine.lint(source);
}
/**
* Parse and validate HTML from multiple files. Result is merged together to a
* single report.
*
* @param filenames - Filenames to read and parse.
* @returns Report output.
*/
public validateMultipleFiles(filenames: string[]): Report {
return Reporter.merge(
filenames.map(filename => this.validateFile(filename))
);
}
/**
* Tokenize filename and output all tokens.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment