html-validate
Advanced tools
Changelog
9.0.0-rc.3 (2024-12-01)
htmlvalidate:recommended
htmlvalidate:document
html-validate:a17y
tag:open
and tag:close
events has been
removed, use tag:begin
and tag:end
instead.Config.resolve()
method can return a Promise
if any
underlying loader or resolver has returned a Promise
.It is recommended to assume it returns a Promise
and always await
the
result:
-const resolved = config.resolve();
+const resolved = await config.resolve();
If you need synchronous code ensure the configuration, the loader and the
resolver all returns synchronous results, e.g. the staticResolver
with
synchronous code.
HtmlValidate.getConfigurationSchema()
method is now async
and returns a Promise
. If you use this method you need to await the result:-const schema = htmlvalidate.getConfigurationSchema();
+const schema = await htmlvalidate.getConfigurationSchema();
Promise
. If you are using test-utils
to write unit tests
you must now resolve the promise. import { transformSource } from "html-validate/test-utils";
-const result = transformSource(transformer, source);
+const result = await transformSource(transformer, source);
This is no matter if your transformer is actually async or not.
CLI.isIgnored(..)
method has been removed from the public
API. There is no replacement. If you need this method open an issue describing
the use-case.CLI
class most methods are now async and
returns Promise
. There is no synchronous version of these API calls.Config.fromFile(..)
and Config.fromObject(..)
will return a
Promise when used with an async loader or resolver.ConfigLoader
methods can optionally return a Promise
for
async operation. For most use-cases this will not require any changes.ConfigLoader.globalConfig
property has been replaced with
ConfigLoader.getGlobalConfig()
(async) and
ConfigLoader.getGlobalConfigSync()
(sync).Config.init()
method has been
removed.Remove any calls to the method:
const config = Config.fromObject({ /* ... */ });
-config.init();
CLI.isIgnored()
made private (1fdcb25)CLI
methods async and return Promise (282049e)Config.fromFile
and Config.fromObject
can return Promise
(5e755d6)Config.resolve()
can return Promise
(1e60c93)ConfigLoader
s can optionally return Promise
for async operation (17dd44f)HtmlValidate.getConfigurationSchema()
returns promise (40f7d54)esmResolver
using import(..)
(ddde616)Config.init()
(19de98d)tag:open
and tag:close
events (5400a7b)ConfigLoader.globalConfig
with ConfigLoader.getGlobalConfig()
(7d740d6)Promise
for async operation (9bd60b5)Promise
for async operation (f173c3f)esmResolver
(db36aa9).htmlvalidate.mjs
configuration files (e148342)