Commit 1dd81d99 authored by David Sveningsson's avatar David Sveningsson
Browse files

feat(htmlvalidate): add `getConfigurationSchema()` to get effective configuration schema

parent b4d1d081
......@@ -535,6 +535,13 @@ describe("HtmlValidate", () => {
`);
});
it("getConfiurationSchema() should get configuration schema", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate();
const schema = htmlvalidate.getConfigurationSchema();
expect(schema).not.toBeUndefined();
});
it("getRuleDocumentation() should delegate call to engine", () => {
expect.assertions(1);
const htmlvalidate = new HtmlValidate();
......
import path from "path";
import { SchemaObject } from "ajv";
import { Config, ConfigData, ConfigLoader } from "./config";
import { Source } from "./context";
import { SourceHooks } from "./context/source";
......@@ -6,6 +7,7 @@ import { Engine, EventDump, TokenDump } from "./engine";
import { Parser } from "./parser";
import { Report, Reporter } from "./reporter";
import { RuleDocumentation } from "./rule";
import configurationSchema from "./schema/config.json";
function isSourceHooks(value: any): value is SourceHooks {
if (!value || typeof value === "string") {
......@@ -219,6 +221,10 @@ class HtmlValidate {
}, [] as string[]);
}
public getConfigurationSchema(): SchemaObject {
return configurationSchema;
}
/**
* Get contextual documentation for the given rule.
*
......
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