Changelog
10.2.1 (2025-10-24)
Bug Fixes
- package republished only, no changes from v10.2.0 (722c37f)
10.2.0 (2025-10-24)
Features
- deps: support vitest v4 (11936fc)
- rules:
aria-label-misusevalidatesaria-labelledbyin addition toaria-label(ef27898) - rules: clearer
aria-label-misuseerror for elements where its strictly allowed but not recommended (7b3a486)
10.1.2 (2025-10-11)
Bug Fixes
10.1.1 (2025-10-06)
Bug Fixes
- fix
unrecognized-char-reftriggering [secure] positives for<script>and<style>tags (efffc6b)
10.1.0 (2025-10-03)
Features
- parse
<textarea>content as literal characters instead of HTML elements (f3d4f5b), closes #314 - store
<script>and<style>content as text node (740b94a), closes #316
10.0.0 (2025-08-09)
⚠ BREAKING CHANGES
- deps: Support for Vitest v0 has been removed. Vitest v1 or later is required.
- deps: Support for Jest v27 has been removed. Jest v28 or later is required.
- deps: NodeJS v20 or later is now required.
Features
- deps: remove support for jest v27 (cb3160e)
- deps: remove support for vitest v0 (3a75046)
- deps: require nodejs v20 or later (f893e34)
- deps: update dependency glob to v11 (f52239d)
9.7.1 (2025-06-28)
Bug Fixes
- docs: fix typo in docs navigation (1a2b87a)
- rules:
no-raw-charactersignores boolean attributes in favor ofattribute-allowed-values(22b18be), closes #296 - rules: allow aria-label on
<dialog>(bd07810), closes #304 - vitest: fix matchers augmentation for typescript (7c4bb69)
9.7.0 (2025-06-15)
Features
- add special
templateRootmeta property for<template>element (beccfda) - rules: add
strictoption towcag/h63to enforce for all tables (51eecf2) - rules: determine if a table is simple or complex before applying
wcag/h63(0e84024), closes #303
Bug Fixes
- better dts for html5 metadata (8e9537c)
9.6.1 (2025-06-14)
Bug Fixes
- validate descendants of
<template>whenscriptSupportingis disabled (f4629f8)
9.6.0 (2025-06-14)
Features
- deps: support jest v30 (2023958)
Bug Fixes
- deps: update dependency ignore to v7.0.5 (731ba29)
9.5.5 (2025-05-25)
Bug Fixes
9.5.4 (2025-05-22)
Bug Fixes
- deps: update dependency ignore to v7.0.4 (f62c179)
- rules: ignore parents of template tags when checking permitted descendants (6a0d48a), closes #305
9.5.3 (2025-04-13)
Bug Fixes
- fix crash when aria attribute references id with comma (fb91b7c), closes #299
- fix crash when attribute selector
[..]contains escaped characters (0c19b82)
9.5.2 (2025-03-17)
Bug Fixes
9.5.1 (2025-03-13)
Bug Fixes
9.5.0 (2025-03-08)
Features
- deps: update dependency @sidvind/better-ajv-errors to v4 (75a17cf)
9.4.2 (2025-03-06)
Performance Improvements
- rewrite and optimize
HtmlElement.matches()increasing performance of large documents (4eb28a7), closes #45
9.4.1 (2025-02-27)
Bug Fixes
- fix another configuration path issue on windows (1967d8f)
9.4.0 (2025-02-22)
Features
- support custom
fsimplementation invalidateFileand similar functions: optional for node required for browser (f9edf65), closes #293
9.3.0 (2025-02-16)
Features
- ensure
widthandheightare non-negative integers on<img>and other embedded elements (6bde9e6), closes #280
Bug Fixes
- cli: fix
--ruleoverwritingextendsfrom--config(5623120) - cli: fix
--ruleoverwriting all rules from--configor--preset(8cc81c8), closes #289 - include id in
valid-iderror message (c0c6b73), closes #282
Performance Improvements
- improve
no-dup-idperformance (8da515f), closes #288 - improve performance for
void-style(5a156de), closes #287
9.2.2 (2025-02-12)
Bug Fixes
9.2.1 (2025-02-05)
Bug Fixes
- fix repetitive "validator crashed" messages (4a71fcf)
- only require SRI on
<link>withrel="stylesheet",rel="preload"orrel="modulepreload"(0b47d2a)
9.2.0 (2025-01-28)
Features
- api: error classes marked internal (84e957b)
- api: new `isUserError(..) to determine if an exception is caused by a user misconfiguration (20dab72)
- deps: support vitest v3 (0926c7f)
Bug Fixes
- better error message when
import.meta.resolveisnt available (8ed0ae8) - cli: fix CLI argument
--confignot finding configuration file on windows (9a1c41c) - deps: update dependency ignore to v7.0.1 (d1ab96e)
- deps: update dependency ignore to v7.0.3 (cbc0f6e)
9.1.3 (2025-01-09)
Bug Fixes
- nodejs 18.19 or later is required (69ec7e2)
9.1.2 (2025-01-08)
Bug Fixes
- fix
ERR_UNSUPPORTED_ESM_URL_SCHEMEon windows (6b193f3)
9.1.1 (2025-01-05)
Bug Fixes
9.1.0 (2024-12-25)
Features
- deps: update dependency ignore to v7 (43ae9ac)
Bug Fixes
- use jest worker for
toMatchCodeframe(3c29ad5)
9.0.1 (2024-12-23)
Bug Fixes
- fix
validateMultipleFilesincorrectly using sync API (0c26918)
9.0.0 (2024-12-23)
ESM support has finally landed in HTML-Validate V9!
- Configuration files (using
.htmlvalidate.mjsor when"type"is"module"inpackage.json). - Plugins, element metadata, shared configurations and transformers can be written natively in ESM.
This release is primarly breaking for API uses but some configuration changes might be required (see below).
For API users the TL;DR version is most functions can return a Promise so make sure to await it.
⚠ BREAKING CHANGES
config: This change affects all users. The following deprecated configuration presets has been removed:
htmlvalidate:recommended- replace withhtml-validate:recommended.htmlvalidate:document- replace withhtml-validate:document.html-validate:a17y- replace withhtml-validate:a11y.
cli: CLI uses ESM (with
esmResolver). For most part this shouldn't affect anything but in some cases you might need slight configuration migration. See Migration Guide for details.cli: use ESM in CLI
meta: The deprecated metadata property expressions have been removed and can be replaced with callback functions. This gives greater control for the metadata author, provides better IDE support and is more reusable when querying the metadata directly.
deps: Requires NodeJS v18 or later.
api:
Config.merge(..)will return aPromisewhen used with an async loader or resolver.api: The deprecated
tag:openandtag:closeevents has been removed, usetag:beginandtag:endinstead.api: The
Config.resolve()method can return aPromiseif any underlying loader or resolver has returned aPromise.It is recommended to assume it returns a
Promiseand alwaysawaitthe 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
staticResolverwith synchronous code.api: The
HtmlValidate.getConfigurationSchema()method is now async and returns aPromise. If you use this method you need to await the result:-const schema = htmlvalidate.getConfigurationSchema(); +const schema = await htmlvalidate.getConfigurationSchema();api: If you are writing your own transformers they may now optionally return a
Promise. If you are usingtest-utilsto 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.
api: The
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.api: If you are using the
CLIclass most methods are now async and returnsPromise. There is no synchronous version of these API calls.api:
Config.fromFile(..)andConfig.fromObject(..)will return a Promise when used with an async loader or resolver.api:
ConfigLoadermethods can optionally return aPromisefor async operation. For most use-cases this will not require any changes.api: The
ConfigLoader.globalConfigproperty has been replaced withConfigLoader.getGlobalConfig()(async) andConfigLoader.getGlobalConfigSync()(sync).api: The redundant and deprecated
Config.init()method has been removed.Remove any calls to the method:
const config = Config.fromObject({ /* ... */ }); -config.init();
Features
- api:
CLI.isIgnored()made private (9e3679a) - api:
CLImethods async and return Promise (677c73e) - api:
Config.fromFileandConfig.fromObjectcan returnPromise(b126361) - api:
Config.merge(..)can returnPromise(cccb313) - api:
Config.resolve()can returnPromise(09159f3) - api:
ConfigLoaders can optionally returnPromisefor async operation (6041581) - api:
FileSystemConfigLoaderusesesmResolverby default (dd4cfb1) - api:
HtmlValidate.getConfigurationSchema()returns promise (f10ec1a) - api: allow transformers to return single source (fd126da)
- api: new
esmResolverusingimport(..)(available for both nodejs and browser) (81b4777), closes #230 - api: remove deprecated
Config.init()(0bd8ab7) - api: remove deprecated
tag:openandtag:closeevents (88ac65e) - api: replace
ConfigLoader.globalConfigwithConfigLoader.getGlobalConfig()(a64935a) - api: resolvers may optionally return
Promisefor async operation (fe3c6a6) - api: transformers may optionally return
Promisefor async operation (823da19) - cli: cli uses esm (with
esmResolver) (3e4759e) - config: remove deprecated configuration presets (dbf5cf4)
- config: support
.htmlvalidate.mjsconfiguration files (0ffd9b5), closes #125 - deps: require node 18 or later (d4f3bcb)
- meta: remove deprecated property expressions (a77043c)
8.29.0 (2024-12-22)
Features
- config: allow to specify transformer function directly in config (df2c752)
- meta: allow
labelableproperty to be a callback (8204b5b)
8.28.0 (2024-12-18)
Features
- refactor jest and vitest
toHTMLValidate(..)matcher (a6a60ab)
8.27.0 (2024-11-30)
Features
8.26.0 (2024-11-26)
Features
8.25.1 (2024-11-24)
Bug Fixes
- fix dump tree output with nested elements (854c274)
8.25.0 (2024-11-11)
Features
Bug Fixes
- properly close elements with optional end tag when implicit document element is used (bbe2a99), closes #268
- types: narrow numeric rule severity to only 0, 1 and 2 (88cf8a2)
8.24.2 (2024-10-16)
Bug Fixes
8.24.1 (2024-10-07)
Bug Fixes
- dont validate quotes in dynamically added attributes (2125d86)
8.24.0 (2024-09-24)
Features
8.23.0 (2024-09-22)
Features
- deps: support vitest v2 (860b0c0)
8.22.0 (2024-09-09)
Features
- api: make
DOMNodeconstructor internal (13377ac) - api: make
HtmlElementconstructor private (fbf4303) - deps: drop
@babel/code-framedependency (0003ffd) - deps: update @sidvind/better-ajv-errors to v3 (3112289)
Bug Fixes
- deps: update dependency ignore to v5.3.2 (9d86e68)
8.21.0 (2024-07-20)
Features
- api: add
DOMTree.readyState(1f6f69b) - api: deprecate
DOMTree.find(..)in favour ofquerySelector(..)(ac0bb77) - api: internal methods of
DOMTreeremoved from public API (79a03be) - api: new
walk.depthFirst(..)API to replace now deprecatedDOMTree.visitDepthFirst(..)method (f9dbda0)
Bug Fixes
- html5:
spellcheckis a global attribute (46594a1)
8.20.1 (2024-06-11)
Bug Fixes
- rules: fix
attribute-allowed-valueserror location for empty values (2c04eeb)
8.20.0 (2024-06-02)
Features
- api: new
setConfigmethod onStaticConfigLoaderto change config (1bf7559) - api: new getter/setter for configuration loader (6283091)
8.19.1 (2024-05-23)
Bug Fixes
- rules:
wcag/h36no longer reports for hidden elements (aba06d1) - rules:
wcag/h37no longer validates<input type="submit">(usewcag/h36instead) (e82b17a), closes #254 - rules: make
wcag/h36have better message and location (8a80cc8)
8.19.0 (2024-05-18)
Features
Bug Fixes
- rules:
multiple-labeled-controlshandles hidden input (4d794b6), closes #251 - rules:
wcag/h30only applies to<a href>(cd93dfe), closes #252 - rules: handle unicode letters in
valid-id(c83687a), closes #253
8.18.2 (2024-04-20)
Bug Fixes
8.18.1 (2024-03-30)
Bug Fixes
- rules:
form-dup-namehandles<template>element (9c77444), closes #247 - rules:
no-dup-idhandles<template>element (04f3e0d), closes #247
8.18.0 (2024-03-23)
Features
- rules: new pattern
bemfor pattern rules (c1ead1b) - rules: new pattern
snakecasefor pattern rules (4b95ccb), closes #245
Bug Fixes
- rules: disallow consecutive hyphens and underscors for kebab-case and snake_case (a4338a7), closes #246
- rules: require initial character for all patterns to be letter (646ff16)
8.17.1 (2024-03-21)
Bug Fixes
8.17.0 (2024-03-19)
Features
- rules: new rule
name-pattern(f2209c0), closes #216 - rules: support multiple patterns in
id-pattern,class-patternandname-patternrules (15dd007)
Bug Fixes
- meta: handle regexp with slash inside (4c88396), closes #242
- rules:
input-missing-labelnow ignores<input>hidden by css (c40e48e), closes #241 - rules:
input-missing-labelnow tests if<label>is inert or hidden by css (d0d6f40) - rules: show pattern name in
id-pattern,class-patternandname-patternrules (4bd70ab)
8.16.0 (2024-03-18)
Features
- api: new
tabIndexproperty reflecting the parsedtabindexattribute (a4e5d5b) - meta: add
inertas global attribute (a5e6477) - meta: new
formAssociated.disablableproperty (0b141ab)
Bug Fixes
- html5:
<summary>element is focusable if child of<details>(79dec74) - rules:
hidden-focusablehandles inert elements (89bb969), closes #240 - rules:
hidden-focusableno longer reports for disabled form controls (d337397) - rules:
hidden-focusableno longer reports for elements withtabindex="-1"(03d7223), closes #240
8.15.0 (2024-03-11)
Features
- rules: new rule
valid-autocomplete(bebd0d1)
Bug Fixes
- rules: case-insensitive match for
urlinmeta-refresh(3177295)
8.14.0 (2024-03-09)
Features
- rules: new option
allowLongDelaytometa-refreshto allow 20h+ delays (629625c)
8.13.0 (2024-03-06)
Features
- meta: allow
<link>under<body>if appropriaterelattribute is present (ae1e070) - meta: allow content categories to be a callback (0eb4e77)
- meta: disallow invalid rel attribute keywords (dc36cfb)
8.12.0 (2024-03-04)
Features
- rules: new rule
no-abstract-role(923680b)
8.11.1 (2024-02-26)
Bug Fixes
- dom: fix regression error with selectors ending with characters
a,dor9(a9a9ef9)
8.11.0 (2024-02-26)
Features
- html5: add new property
aria.namingrepresenting if the element can be named (4fca264) - html5: update role metadata from html-aria standard (b029a3f)
- meta: move
implicitRoletoaria.implicitRole(bc8cacf)
Bug Fixes
- handle selectors containing tabs and newlines (5e45d54), closes #238
- rules: new option
allowAnyNamableforaria-label-misuse(c08a3ba), closes #237
8.10.0 (2024-02-21)
Features
- rules: new rule
no-implicit-input-type(6cc0c6d)
Bug Fixes
- deps: update dependency ignore to v5.3.1 (4553b89)
- html5:
typefor<input>no longer required (37284d0), closes #235 - rules: change wording required to recommended in
no-implicit-button-type(1926c06)
8.9.1 (2024-01-10)
Bug Fixes
- rules:
<form>and<section>without explicit accessible name is no longer considered landmark (a36deac) - rules:
<header>and<footer>nested in<main>or sectioning content is no longer considered landmark (bcab354), closes #234
8.9.0 (2024-01-08)
Features
- elements: new property
focusableto mark elements as focusable (c59c8b2) - rules: new rule
hidden-focusable(243e7fb) - rules: new rule
unique-landmark(187be1e)
Bug Fixes
- api: remove internal
listenersproperty from public API (303e5d5) - dom: ancestor with
role="presentation"no longer counts decendants as missing from a11y tree (cc72da1) - dom: handle
role="none"as a synonym forrole="presentation"(b1d7b50) - dom: interactive and focusable elements ignore
role="presentation"(017308f) - rules: better error description for
require-sri(ffc3695) - rules: rule
wcag/h30no longer requires text on<a hidden>(a20cc84) - rules: rule
wcag/h30no longer requires text on links withdisplay: noneorvisibility: hidden(36ff07e) - rules: rules
wcag/h32handles<button>without explicittype(84c6a6e)
8.8.0 (2023-12-27)
Features
- api:
Report.merge()can merge async results (35689fc) - api: rename
nodejsResolvertocjsResolver(8c72c8f) - config: new
defineConfighelper (35e265a)
Bug Fixes
- config: proper error message when certain configuration properties was invalid (b029569)
8.7.4 (2023-12-10)
Bug Fixes
8.7.3 (2023-11-23)
Bug Fixes
- disable
doctype-stylewhen using prettier preset (f1f4004)
8.7.2 (2023-11-18)
Bug Fixes
- deps: update dependency ignore to v5.3.0 (143e994)
8.7.1 (2023-11-11)
Bug Fixes
8.7.0 (2023-10-21)
Features
- html5: support
referrerpolicyattribute (851b559)
8.6.1 (2023-10-21)
Bug Fixes
- dom: remove usage of regex negative lookbehind (f406393), closes #147
- rules: improve
attribute-misuseerror message (fccce69), closes #226 - typo in CONTRIBUTING.md (855bacf)
8.6.0 (2023-10-13)
Features
- api: add
meta: MetaAttributeinAttributeEvent(2cda0ae) - cli:
--ruleseverity can now be set with strings, fixes #225. (054972e)
8.5.0 (2023-10-01)
Features
8.4.1 (2023-09-23)
Bug Fixes
- rules: fix contextual documentation for
attr-patternrule (0082aef)
8.4.0 (2023-09-09)
Features
- html5: support
<search>element (720bdd9) - new
implicitRolemetadata for better handling of implicit ARIA roles (fe45ec4), closes #224
8.3.0 (2023-08-20)
Features
Bug Fixes
- html5:
<label>cannot have emptyfor(3626e1a), closes #223 - html5:
element-required-attributesallows<button>withouttype(useno-implicit-button-typeinstead) (d32f492), closes #221
8.2.0 (2023-08-07)
Features
- add
allowedIfParentIsPresentmetadata helper (2668899) - html5: add
<source>attributes metadata (e3a3311) - support passing native
HTMLElementto metadata helpers (8af6d01), closes #207
Bug Fixes
- api: typing for
Rule.setSeverity()changed to only acceptSeverity(64f4210)
8.1.0 (2023-07-22)
Features
Bug Fixes
- add
compatibilityCheckfunction to browser bundle (b89dcc2) - api: remove unintended
nullreturn value from plugins api (0eb0ea8)
8.0.5 (2023-06-13)
Bug Fixes
- fix import issue with
elements/html5.js(0604c21), closes #219 - make
elements/html5work with esm (d95de27)
8.0.4 (2023-06-12)
Bug Fixes
- add explicit node import (73f9a1f)
8.0.3 (2023-06-12)
Bug Fixes
- fix regression bug when using
elementsin extended configuration files and plugins (6892083) - use correct dts when using custom conditions (1b6971e)
8.0.2 (2023-06-10)
Bug Fixes
- add
browsercondition for main import (d2f7a74) - remove usage of
node:pathandprocessin browser build (2580aeb)
8.0.1 (2023-06-10)
Bug Fixes
- fix nodejs code being included in browser bundle (7c76a3b)
8.0.0 (2023-06-04)
⚠ BREAKING CHANGES
See migration guide for details.
- api: The
ConfigFactoryparameter toConfigLoader(and its child classesStaticConfigLoaderandFileSystemConfigLoader) has been removed. No replacement.
If you are using this you are probably better off implementing a fully custom
loader later returning a ResolvedConfig.
- api: A new
getContextualDocumentationreplaces the now deprecatedgetRuleDocumentationmethod. The context parameter togetRuleDocumentationis now required and must not be omitted.
For rule authors this means you can now rely on the context parameter being
set in the documentation callback.
For IDE integration and toolchain authors this means you should migrate to use
getContextualDocumentation as soon as possible or if you are continuing to use
getRuleDocumentation you are now required to pass the config and context
field from the reported message.
- api: This change affect API users only, specifically API users
directly using the
Configclass. Additionally when using theStaticConfigLoaderno modules will be resolved usingrequire(..)by default any longer. Instructions for running in a browser is also updated, see below.
To create a Config instance you must now pass in a Resolver (single or
array):
+const resolvers = [ /* ... */ ];
-const config = new Config( /* ... */ );
+const config = new Config(resolvers, /* ... */ );
This applies to calls to Config.fromObject(..) as well.
The default resolvers for StaticConfigLoader is StaticResolver and for
FileSystemConfigLoader is NodeJSResolver. Both can optionally take a new set
of resolvers (including custom ones).
Each resolver will, in order, try to load things by name. For instance, when
using the NodeJSResolver it uses require(..) to load new items.
NodeJSResolver- usesrequire(..)StaticResolver- uses a predefined set of items.- api: The
HtmlValidateclass now has aPromisebased API where most methods return a promise. The old synchronous methods are renamed.
Either adapt to the new asynchronous API:
-const result = htmlvalidate.validateFile("my-awesome-file.html");
+const result = await htmlvalidate.validateFile("my-awesome-file.html");
or migrate to the synchronous API:
-const result = htmlvalidate.validateFile("my-awesome-file.html");
+const result = htmlvalidate.validateFileSync("my-awesome-file.html");
For unittesting with Jest it is recommended to make the entire test-case async:
-it("my awesome test", () => {
+it("my awesome test", async () => {
const htmlvalidate = new HtmlValidate();
- const report = htmlvalidate.validateString("...");
+ const report = await htmlvalidate.validateString("...");
expect(report).toMatchCodeFrame();
});
- api:
ConfigLoadermust returnResolvedConfig. This change affects API users who implements custom configuration loaders.
In the simplest case this only requires to call Config.resolve():
-return config;
+return config.resolve();
A resolved configuration cannot further reference any new files to extend, plugins to load, etc.
- api: The
TemplateExtractorclass has been moved to the@html-validate/plugin-utilspackage. This change only affects API users who use theTemplateExtractorclass, typically this is only used when writing plugins. - config: Deprecated severity alias
disabledremoved. If you use this in your configuration you need to update it tooff.
{
"rules": {
- "my-awesome-rule": "disabled"
+ "my-awesome-rule": "off"
}
}
- rules: The
voidrule has been removed after being deprecated a long time, it is replaced with the separatevoid-content,void-styleandno-self-closingrules. - deps: minimum required node version is v16
- deps: minimum required jest version is v27
Features
- api:
ConfigLoadermust returnResolvedConfig(d685e6a) - api:
FileSystemConfigLoadersupports passing a customfs-like object (fac704e) - api: add
Promisebased API toHtmlValidateclass (adc7783) - api: add
Resolverclasses as a mean to separatefsfrom browser build (3dc1724) - api: new
getContextualDocumentationto replacegetRuleDocumentation(60c9a12) - api: remove
ConfigFactory(e309d89) - api: remove
TemplateExtractorin favour of@html-validate/plugin-utils(a0a512b) - deps: minimum required jest version is v27 (dc79b6b)
- deps: minimum required node version is v16 (f6ccdb0)
- rules: remove deprecated
voidrule (3e727d8)
Bug Fixes
- config: remove deprecated severity alias
disabled(6282293)
7.18.1 (2023-06-04)
Bug Fixes
- cli: error message on missing --config file (e948a18)
7.18.0 (2023-05-24)
Features
Bug Fixes
- api: mark
Config.fromFile()as internal (3e70028) - api: mark
Config.getMetaTable()as internal (8cb6dd0) - api: mark
dumpEvents,dumpSource,dumpTokensanddumpTreeas internal (866f219) - jest:
toMatchCodeframeandtoMatchInlineCodeframehandles async result (584c67e)
7.17.0 (2023-05-12)
Features
- allow to specify plugins inline in configuration (6ba1467)
Bug Fixes
- rules: allow custom elements to use
aria-label(513a813)
7.16.0 (2023-05-04)
Features
- api:
ConfigLoaderreturns aResolvedConfig(1fd8b73)
Dependency upgrades
- deps: update dependency @html-validate/stylish to v4 (2a089ec)
7.15.3 (2023-05-03)
Bug Fixes
- api: remove unused
urlimport (a2017ff)
7.15.2 (2023-05-03)
Bug Fixes
- api: fix typescript not finding type declarations (0950bb9), closes #217
- rules:
form-dup-namedefaults to allow<button type="submit">to share name (b39b9ad), closes #212
Dependency upgrades
- deps: update dependency glob to v10 (1855cf0)
7.15.1 (2023-04-09)
Bug Fixes
- add missing exports (7fb141d)
- fix
html-validate/test-utilsentrypoint (62fbee3) - include tsdoc-metadata.json (61dd7dd)
7.15.0 (2023-04-09)
Features
- dts rollup (9743e9c)
Bug Fixes
- dom:
querySelectortypescript declaration returns null to match implementation (9c9befe) - fix browser entrypoint for older bundlers (c8320ba)
7.14.0 (2023-03-26)
Features
- rules: add
[role="alertdialog"]as a default sectioning root forheading-level(b87581a)
Bug Fixes
- cli: fix glob pattern when file extension list is empty (d95a418)
Dependency upgrades
- deps: update dependency glob to v9 (effd3bc)
7.13.3 (2023-03-10)
Bug Fixes
7.13.2 (2023-02-08)
Bug Fixes
- add button and reset types to form-dup-name shared options (d6ef9f8)
7.13.1 (2023-01-15)
Bug Fixes
no-unused-disableproperly reports location when more than two rules are disabled (26d1970)- allow
no-unused-disableto be disabled by directive (b11166c)
7.13.0 (2023-01-15)
Features
- expose
Validatorhelper (6ef10dd), closes #204 - report unused disable directives (5a2731f), closes #196
7.12.2 (2023-01-09)
Bug Fixes
form-dup-namevalidate checkboxes by default (d5e7b7d), closes #202- add
allowArrayBracketsoption toform-dup-namerule (a43ea0b), closes #203 - add
sharedoption toform-dup-nameto set which controls allow shared names (7ddc02b), closes #201
7.12.1 (2023-01-05)
Bug Fixes
7.12.0 (2022-12-28)
Features
- api:
Attribute.valueMatchescan take array of keywords to match against (0a5ff8e) - api: add
Rule.getMetaFor(..)(5a76381) - api: add new
formAssociatedproperty when defining metadata (3d56c4a) - meta:
MetaAttributeAllowedCallbacktakes the attribute as second argument (7a4edeb) - rules: new rule
form-dup-name(74f8e2d), closes #197 - rules: new rule
map-id-name(abe5acb), closes #184
Bug Fixes
- parser: enable cache api on document root (a1cfe64)
7.11.1 (2022-12-22)
Bug Fixes
- allow setting metadata attribute to
nullto remove it (7118d9b) - better error message when element inheritance fails (717c186)
7.11.0 (2022-12-19)
Features
- api: add
keywordPatternMatcherfor usage withinclude/excludeoptions (6bd360f) - rules: add
includeandexcludesupport tono-unknown-elements(cd7fb23) - validateOccurrences and element-permitted-occurences support tag category (b37d9ac)
Bug Fixes
- hgroup is still valid, support the current content model (4040db3), closes #198
- rules: improve error message for
wcag/h63(fa16f51) - rules: improved error message with
element-required-contentusing categories (a71a2d8)
7.10.1 (2022-12-04)
Bug Fixes
- allow
aswithprefetch(54ceeb1)
7.10.0 (2022-11-17)
Features
- rules: add
wcag/h63for header cell scopes (ee012c6)
Bug Fixes
- html5:
<th>does not requirescopeattribute (44bb935), closes #189 - rules:
empty-headinghandleshiddenattribute (e33b55e), closes #193 - rules:
wcag/h30handleshiddenattribute (c5ac930)
7.9.0 (2022-11-16)
Features
- new
definePluginhelper (e28c275) - rules: new option
ignoreCaseadded tounrecognized-char-ref(4a1b9af) - rules: new option
requireSemicolonadded tounrecognized-char-ref(b7a5067) - rules: new rule
map-dup-name(ad7bfff), closes #180
Bug Fixes
- rules: add selector to
unrecognized-char-referrors (73b29ef) - rules: include different capitalization for named character references (html entities) (83f205a), closes #192
7.8.0 (2022-10-31)
Features
- html5: bundle element metadata (1e59f3e)
Bug Fixes
- api:
getFormatterts declaration guarantees aFormatterwill be returned for known formatters (14ce8b1)
7.7.1 (2022-10-24)
Bug Fixes
- api: export browser bundle as
html-validate/browser(dc1c322) - html5: handle
<meta property>(RDFa such as OG) (63e8814), closes #187
7.7.0 (2022-10-23)
Features
- html5: validates
<a target>and<area target>for valid keywords (6fa0bd9) - new
defineMetadatahelper for writing custom element metadata (6a06811), closes #186 - rules: new rule
area-alt(3c1f0b3), closes #178 - rules: new rule
attribute-misuse(07a0bbe), closes #181
Bug Fixes
- html5:
<map>requiresnameattribute (6104eb3) - html5:
<meta charset>should only allowutf-8(aaa15fe) - html5: disallow
<area coords>whenshapeisdefault(76115f2), closes #183 - html5: mark
<keygen>as deprecated (859402d) - html5: require
<area coords>whenshapeis requires is (ed750c1), closes #182
7.6.0 (2022-10-10)
Features
input-missing-labelchecks for presence of text (4aa7d77), closes #170- api: add
HtmlElement.ariaLabelledby(8463d43) - api: expose
classifyNodeTexthelper (97621fd) - api: new rule helper
hasAccessibleText(b8f8330) - rules:
classifyNodeTexthelper respectshiddenandaria-hiddenattributes (8ba2c5a) - rules:
classifyNodeTextoption to ignore hidden attribute on element (41ba7f9) - rules:
isHTMLHiddenandisAriaHiddencan return detailed results (fb28c2e)
Bug Fixes
<select>does no longer classify as having text content (3fb1d15)<textarea>does no longer classify as having text content (04517cf)- rules:
empty-headingsatisfied by images with alt text (ff68fbb), closes #176
7.5.0 (2022-09-19)
Features
7.4.1 (2022-09-11)
Bug Fixes
input-missing-labelshould ignore<input type="reset">too (280bb5c)- allow
<template>as parent to<li>(aa0aadc)
7.4.0 (2022-09-11)
Features
Bug Fixes
- html5:
<meta itemprop>can be used where flow or phrasing is expected (0c6c74c), closes #168 - rename preset
html-validate:a17ytohtml-validate:a11y(typo fix) (0440fcd), closes #171 - rules:
input-missing-labelnow ignores input typesubmitandbutton(39317da), closes #170 - rules: improve error message when alt is empty (8f50e8f)
- rules: verify presence of alt attribute on
<input type="image">(feeb56e)
7.3.3 (2022-08-25)
Bug Fixes
<form>action attribute false positives (f93a8fc), closes #167- cli: fix typo in maximum warnings message (8971323)
7.3.2 (2022-08-24)
Bug Fixes
7.3.1 (2022-08-21)
Bug Fixes
- handle quoted
.,#,:and[in attribute selectors (7282625), closes #162 #147 - html5: disallow empty
actionattribute on<form>(0cdb7b2), closes #165
7.3.0 (2022-08-11)
Features
7.2.0 (2022-08-04)
Features
- html5: add
<dialog>element (243bf56), closes #160 - rules:
element-permitted-contentlists all required ancestors (be34e01) - rules:
element-permitted-contentverifies root element (6eb721f) - rules: split ancestor validation from
element-permitted-contentto new ruleelement-required-ancestors(dcb2096)
Bug Fixes
- api: allow passing object when reporting errors (f8500be)
- api: hide internal properties when using
--dump-events(206294f) - html5:
<body>should only accept flow content (1b08c66) - html5:
<li>requires<ul>,<ol>or<menu>parent (b88384e) - rules:
element-permitted-contentdocumentation fixes (613dd48)
7.1.2 (2022-07-05)
Bug Fixes
- add missing metadata for SVG
<title>and<desc>elements (78ec55f), closes #157 - escape additional characters in CSS selectors (774ba95), closes #158
7.1.1 (2022-05-22)
Bug Fixes
Dependency upgrades
- deps: update dependency @html-validate/stylish to v3 (23549e3)
7.1.0 (2022-05-15)
Features
- rules: add
anyoption toattr-quotes(cedf9d5), closes #152 - rules: add
include/excludeoptions torequire-srirule (93931c5), closes #153 - rules: new rule
require-csp-nonce(d534a32)
Dependency upgrades
- deps: update dependency @sidvind/better-ajv-errors to v2 (bd27e3c)
7.0.0 (2022-05-06)
⚠ BREAKING CHANGES
See migration guide for details.
- require node 14
Features
- require node 14 (e294b5e)
6.11.1 (2022-05-06)
Bug Fixes
- add type declaration for
html5.js(4647dee) - expose
MetaDataTabletype (79f30d0) - fix loading
jest.jsandtest-utils.js(84877df)
6.11.0 (2022-05-05)
Features
- deps: support jest 28 (458e460)
Bug Fixes
- handle windows
\\when expanding directories (dfe3dbf)
6.10.0 (2022-05-04)
Features
- jest: add
.toMatchCodeframe()as complement to.toMatchInlineCodeframe()(23473e4) - jest: support passing string to
toMatch{,Inline}Codeframe()(1864e43)
Bug Fixes
- jest: extend recommended config when using
toHTMLValidate()(5c890ea)
Performance Improvements
- improve performance by caching json schema (6be5c3a)
6.9.1 (2022-04-29)
Bug Fixes
6.9.0 (2022-04-27)
Features
- new rule
valid-id(706000b)
Bug Fixes
6.8.0 (2022-04-24)
Features
tel-non-breakingchecks for presence ofwhite-space: nowrap(6d1b968)- deferred generation of selectors for error messages for more accurate results (ac98c6e)
- implement
styleproperty onHtmlElement(f6f8ad2) - jest: add new
toMatchInlineCodeframematcher (dc0eab4) - jest: remove internal
toBeTokenmatcher from public consumption (15f7e1c) - migrate
html5.jsontohtml5.js(6316b98) - require jest 25.1 or later (f4fad37)
Dependency upgrades
- deps: update dependency glob to v8 (ccb6dd4)
6.7.1 (2022-04-08)
Bug Fixes
- rules: fix reported selector for
tel-non-breakingerrors (0909ce4) - rules: show character description in
tel-non-breaking(894d456)
6.7.0 (2022-04-08)
Features
Bug Fixes
- cli: proper argument count to
--print-config(91c1a45) - remove unnecessary fields from published package.json (06528c7)
- rules: better error message for
attr-delimiter(acf4249)
6.6.1 (2022-03-25)
Bug Fixes
- api: typescript declaration for
ProcessElementContextupdated (e843b8c)
6.6.0 (2022-03-20)
Features
Bug Fixes
- cli: report error when mode flags are missing filename (7e87cd4), closes #144
- disable
svg-focusableby default (d15a503)
6.5.0 (2022-02-27)
Features
- rules: support message interpolation (9356809)
- support
--as delimiter for comments (7c90250), closes #143 - throw error when directive is missing end bracket (4cba14b)
Bug Fixes
- dom: proper location when using
DOMTokenListwith multiple whitespace (7b2d62c)
6.4.0 (2022-02-18)
Features
- dom: add typeguards to attribute API (f831223)
- event: add parent element to
conditionalevent (b248e3b)
Bug Fixes
6.3.2 (2022-02-16)
Bug Fixes
- handle reading stdin (
/dev/stdin) on Windows (dcf65d1), closes #141 - replace
\\in urls generated on Windows (950b3cf), closes #140
6.3.1 (2022-02-03)
Dependency upgrades
- deps: update dependency @sidvind/better-ajv-error to v1.1.1 (8aa3438)
6.3.0 (2022-02-03)
Features
- new rule
aria-hidden-body(4f3b04f)
Bug Fixes
- global element metadata is returned for unknown elements (831f227)
- rules: improve error message for
element-required-content(b29d908) - rules: improve error message for
empty-title(0a62b1a)
Dependency upgrades
- deps: update dependency @sidvind/better-ajv-error to v1.1.0 (f785448)
6.2.0 (2022-01-17)
Features
- expose
isTextNode()(502ef09)
Bug Fixes
- rules: improve error message for
attribute-allowed-values(b3d4d11)
6.1.6 (2022-01-07)
Bug Fixes
- meta: disallow unknown element properties (aca70fc)
Dependency upgrades
- deps: drop json-merge-patch dependency (5306b2d)
6.1.5 (2021-12-28)
Bug Fixes
- config: dont process extends multiple times (f014311)
- config: elements from extended configs should be loaded first not last (d19519e)
6.1.4 (2021-12-04)
Bug Fixes
6.1.3 (2021-11-19)
Bug Fixes
- parse
<style>content as text instead of markup (0ab61e6), closes #137 - rules: handle malformed
styleattribute inno-inline-stylerule (7e12d50)
6.1.2 (2021-11-13)
Bug Fixes
- fix .d.ts paths in package (f24c2f4)
6.1.1 (2021-11-10)
Dependency upgrades
- deps: update dependency @sidvind/better-ajv-errors to v1 (373b608)
6.1.0 (2021-10-02)
Features
- rules:
allowed-linkssupportincludeandexclude(a3f7b6a)
Bug Fixes
6.0.2 (2021-09-27)
Bug Fixes
- jest: jest matcher should use FileSystemConfigLoader (4d04bdc)
6.0.1 (2021-09-27)
Bug Fixes
- docs (4973ee4)
6.0.0 (2021-09-26)
⚠ BREAKING CHANGES
See migration guide for details.
- htmlvalidate: This change only affects API users, the CLI tool continues to work as before.
The default configuration loader has changed from FileSystemConfigLoader to
StaticConfigLoader, i.e. the directory traversal looking for
.htmlvalidate.json configuration files must now be explicitly enabled.
- event:
ConfigReadyEventpassesResolvedConfiginstance instead ofConfigData - meta:
MetaElement.attributehas changed fromstring[]toMetaAttribute[]and bothrequiredAttributesanddeprecatedAttributeshas been merged into object. This only affects API usage, primarily custom rules accessing attribute metadata.SeeMIGRATION.mdfor details.
The old format is deprecated but is internally converted as to not break user configuration. For compatibility it will probably be around for quite a while but users should try to migrate as soon as possible.
Features
- bump required node version to 12.22 (80f3399)
- elements: migrate bundled html5 element metadata to new attribute syntax (6132b82)
- event:
ConfigReadyEventpassesResolvedConfiginstance instead ofConfigData(5808a6b) - htmlvalidate: use
StaticConfigLoaderby default (bb94341) - meta: add new list property to
MetaAttribute(4c1e3c9) - meta: extend element attribute metadata (6506aa6), closes #71
Dependency upgrades
- deps: update dependency espree to v9 (3e0ea96)
4.14.1 (2021-09-18)
Bug Fixes
- jest: handle when
jest-diffdefault import is object (74f9b84)
5.5.0 (2021-09-05)
Features
- dom: add iterator to
DOMTokenList(7bef736) - rules:
no-missing-referenceshandles more aria attributes (2843680) - rules: add
minInitialRankoption toheading-level(7f58572), closes #132
Bug Fixes
- jest: synchronous matchers as long as the passed value is synchronous (0ede9f7)
- rules:
no-missing-referenceshandles attributes with reference lists (2afcd86), closes #133
5.4.1 (2021-08-29)
Bug Fixes
5.4.0 (2021-08-27)
Features
Bug Fixes
5.3.0 (2021-08-23)
Features
- jest matchers support async results (ef7331f)
Bug Fixes
- jest: handle when
jest-diffdefault import is object (7413db9)
5.2.1 (2021-08-09)
Bug Fixes
5.2.0 (2021-07-23)
Features
- support specifying a custom loader when using library (0e509a3)
- config: add
StaticConfigDatafor simple static config (ae40706)
Bug Fixes
- elements: disallow whitespace in
id(df2906b) - meta: regex matching attribute allowed values matches entire string (ffa0d12)
- rules: handle id with whitespace in
no-redundant-for(a79f266), closes #128
5.1.1 (2021-07-11)
Bug Fixes
5.1.0 (2021-07-11)
Features
- lexer: add attribute key-value delimiter to attribute value token (0979798)
- rules: new rule
attr-delimiter(eb98461), closes #126 - support .cjs configuration files (cd458e3)
Bug Fixes
- automatically find external dependencies (62af8c5)
- es build (6b1cec5)
- import semver correctly (4ed8eac)
- make prefer-button tag and attribute checks case-insensitive (95e7748)
- only check value of type attribute in prefer-button rule (2e46586)
5.0.2 (2021-06-28)
Bug Fixes
5.0.1 (2021-06-27)
Bug Fixes
- custom log callback for
compatibilityCheck(cbd2226)
Dependency upgrades
- deps: update dependency @html-validate/stylish to v2 (ab0b1f9)
5.0.0 (2021-06-27)
⚠ BREAKING CHANGES
- the library is now shipped as a hybrid CJS/ESM package. If you are simply consuming the CLI tool or one of the existing integrations this will not affect you.
For plugin developers and if you consume the API in any way the biggest change is that the distributed source is now bundled and you can no longer access individual files.
Typically something like:
-import foo from "html-validate/dist/foo";
+import { foo } from "html-validate"
Feel free to open an issue if some symbol you need isn't exported.
If your usage includes checking presence of rules use the ruleExists helper:
-try {
- require("html-validate/dist/rules/attr-case");
-} catch (err) {
- /* fallback */
-}
+import { ruleExists } from "html-validate";
+if (!ruleExists("attr-case")) {
+ /* fallback */
+}
- drop support for NodeJS 10
Features
- add
compatibilityCheckhelper for plugins (4758595) - cjs/esm hybrid package (39c960a), closes #112
- drop support for NodeJS 10 (8f74291)
Dependency upgrades
- deps: update dependency ajv to v8 (cccb73a)
4.14.0 (2021-06-14)
Features
4.13.1 (2021-05-28)
Bug Fixes
- jest: fix
TypeError: diff is not a function(2afc2e8)
4.13.0 (2021-05-28)
Features
- jest: better compatibility with jest in node environment (79d14ca)
Dependency upgrades
- deps: support jest v27 (863f73d)
- deps: update dependency @sidvind/better-ajv-errors to ^0.9.0 (8f6d162)
4.12.0 (2021-05-17)
Features
- rules: enforce initial heading-level in sectioning roots (c4306ad)
4.11.0 (2021-05-08)
Features
dom:readyanddom:loadcontainssourcereference (430ec7c), closes #115- add
:scopepseudoselector (6e3d837), closes #114 - add
isSameNode()(7d99007) - add new event
source:ready(4c1d115), closes #115 - rules:
deprecatedtakesincludeandexcludeoptions (e00d7c1)
Bug Fixes
- dom: throw if
tagNameis invalid (42d7100)
4.10.1 (2021-04-25)
Bug Fixes
- handle directives with excessive whitespace (0400563)
4.10.0 (2021-04-18)
Features
- dom: implement {first,last}ElementChild accessors (5e70aee)
- formatters:
stylishandcodeframedisplays links to error descriptions (86cf213), closes #113 - formatters: checkstyle output is indented (e284fb7)
- parser: add full location to
attrevent (key, quotes, value) (931a39f) - rules: add rule url to
Message(6845fac) - rules: new option
allowedPropertiestono-inline-style(defaults todisplay) (75aa5f0)
Bug Fixes
- rules: rule documentation url for rules in subdirectories (c91c36d)
4.9.0 (2021-04-04)
Features
Bug Fixes
- config: validate preset configurations (dca9fc3)
- error: present original json for configuration errors (23a50f3)
- meta: memory leak when loading meta table (940ca4e), closes #106
4.8.0 (2021-03-28)
Features
4.7.1 (2021-03-19)
Bug Fixes
- add
$schematohtml5.json(9a89d30)
4.1.1 (2021-03-19)
Bug Fixes
$schemakeyword being invalid (3b67062)
4.7.0 (2021-03-14)
Features
Bug Fixes
- dom:
input[type="hidden"]no longer labelable (244d37d)
4.6.1 (2021-03-02)
Bug Fixes
- dom:
generateSelector()escapes characters (c2e316c), closes #108 - dom:
querySelectorhandles escaped characters (30e7503) - dom: throw error when selector is missing pseudoclass name (516ca06)
4.6.0 (2021-02-13)
Features
- parser: add DOCTYPE tag to
DoctypeEvent(8c53d40) - parser: new event
tokenemitted for each lexer token (f9d44d6) - rules: allow rules to unregister event listeners (8b1a6bc)
- rules: new rule
attr-spacingrequiring attributes to be separated by whitespace (7734dc6), closes #105 - rules: new rule
doctype-stylerequiring doctype to be specific case (e94f819) - rules: new rule
no-utf8-bomdisallowing usage of UTF-8 BOM (7a2d264)
Bug Fixes
- lexer: handle CRLF after xml declaration (97fd77d)
- lexer: handle doctype with mixed case (a40e28e)
- lexer: handle html comment before doctype (6c1b830)
- lexer: handle unicode bom (97506b1)
4.5.0 (2021-02-05)
Features
- meta:
transparentcan be limited to specific elements (bef8a16)
Bug Fixes
4.4.0 (2021-01-31)
Features
- events: new event
tag:readyemitted when start tag is parsed (cfbf3dc) - events: rename
tag:openandtag:closetotag:startandtag:end(7a2150f) - rules:
heading-levelsupports sectioning roots (8149cc6), closes #92
Bug Fixes
- rules: better error message for
heading-level(0871706)
Dependency upgrades
- deps: update dependency @sidvind/better-ajv-errors to ^0.8.0 (f317223)
4.3.0 (2021-01-19)
Features
- rules: new rule
text-content(2fef395), closes #101 - transform: new helper
processElementfor writing tests (3052f81) - add
browserentry point without cli classes (7840ec2) - set
sideEffectstofalse(41b47f8)
Bug Fixes
- dom:
DOMTokenList(such asclasslist) handles newlines and tabs (35e601e)
4.2.0 (2021-01-15)
Features
- dom: disable cache until node is fully constructed (5e35c49)
- htmlvalidate: add
getConfigurationSchema()to get effective configuration schema (1dd81d9) - htmlvalidate: add
getElementsSchema()to get effective elements schema (4baac36), closes #78 - rule: support filter callback for rule events (f3f949c)
- rules: add
allowMultipleH1option toheading-level(a33071d)
Bug Fixes
- enable
strictNullCheck(64b5af2), closes #76 - event:
locationproperty can benullfor some events (fbbc87c) - event: pass
nullwhen attribute value is missing (08c2876) - rules: rule options uses
Partial<T>(221113b)
Dependency upgrades
- deps: update dependency ajv to v7 (4c04388)
4.1.0 (2020-12-14)
Features
- replace
inquirerwithprompts(82d17eb)
4.0.2 (2020-11-19)
Bug Fixes
- deps: replace dependency on
eslintwith@html-validate/stylish(2d1bc81)
4.0.1 (2020-11-09)
Bug Fixes
- rules:
wcag/h32checks fortype="image"(4a43819) - rules:
wcag/h32handles submit buttons usingformattribute to associate (cb2e843)
4.0.0 (2020-11-07)
⚠ BREAKING CHANGES
- config: With this release any custom configuration files will no longer
automatically extend
html-validate:recommended.
The previous behaviour was to to always merge with the default configuration
containing extends: ["html-validate:recommended"]. This is counter-intuitive
when adding a blank {} .htmlvalidate.json configuration file (or a file with
extends: []). The new behaviour is to not apply default configuration if
another configuration is found.
To retain the previous behaviour you must ensure your configuration contains
extends: ["html-validate:recommended"]. Users who have root: true are not
affected. If unsure: test your configuration by deliberatly introducing and
error and verify it is detected.
For CLI users: ensure your .htmlvalidate.json configuration files are updated.
For IDE integration users: ensure your .htmlvalidate.json configuration files
are updated.
For CLI API users: same as with CLI the configuration loading has changed and
all users must update their .htmlvalidate.json accordingly.
For HtmlValidate API users: you are most likely not affected, only if both of
the following conditions are true you need to take care to ensure any
.htmlvalidate.json is updated:
- you are using
validateFileor supply filenames to other validation functions. - you allow user-supplied configurations (or use them yourself) via
.htmlvalidate.json(default unlessroot: trueis set in the configuration object passed tonew HtmlValidate(..))
The ConfigLoader API has also been updated and fromTarget may now return
null if no configuration file was found.
- The
buildfolder has been renamed todist.
This affects API users only and in general should not be an issue unless
importing files via full path. In that case replace import 'html-validate/build/...' with import 'html-validate/dist/... but in general
those imports are discouraged.
Instead users should import only via import { ... } from "html-validate" and file an issue
if an export is missing.
This does not affect the elements imports which is considered a safe to import
as-is.
- Only node 10 or later is supported
Features
- new utility function
ruleExiststo test presence of bundled rules (09aad04) - rules: new helper
isHTMLHidden(ae20335) - shim: add new export
html-validate/test-utilsexposing test-utils (30f5d40) - shim: expose all event structures in shim (294bb0d)
- shim: expose metadata structures (271e521)
Bug Fixes
- config: dont automatically apply
extends: ["html-validate:recommended"](fcad0b2), closes #98 - require node 10 (d1a48b1)
- rules:
input-missing-labelhandles multiple labels (a6af2da) - rules:
input-missing-labelignores hidden<input>(41c39e9) - rules:
input-missing-labelrequires label to be non-hidden (ff5e855), closes #99
Miscellaneous Chores
- migrate to
distfolder (3c6787c)
3.5.0 (2020-10-18)
Features
- rules: new rule
no-multiple-main(fa3c065)
3.4.1 (2020-10-13)
Bug Fixes
3.4.0 (2020-10-08)
Bug Fixes
- deps: update dependency acorn-walk to v8 (5a41662)
- rules: fix issue in
no-dup-idwhere value is dynamic (203debe), closes #96
Features
- api: add additional prototypes to
validateString(69e8102) - dom: new api for caching data on
DOMNode(13d99e4) - rules: implement caching in some helper methods (5746d6c)
3.3.0 (2020-09-08)
Bug Fixes
- jest: add missing
filenameto typescript declaration (4be48fa) - meta: default to pass when testing excluded category from unknown element (07afa1a)
- rules: handle unknown elements better in
element-permitted-content(58ba1aa), closes #95
Features
- jest:
toHTMLValidate()supports passing expected errors (7b3c30e)
3.2.0 (2020-08-26)
Features
- rules: new rule allowed-links (d876206)
3.1.0 (2020-08-20)
Bug Fixes
- rules:
no-redundant-forshould only target<label>(a2395b6)
Features
- meta: new property
labelable(bf5cd6e) - rules: new rule
multiple-labeled-controls(ee28774), closes #86 - rules: new rule
no-redundant-for(d4445bb), closes #87
3.0.0 (2020-06-21)
Bug Fixes
- deps: update dependency chalk to v4 (614da1b)
- deps: update dependency eslint to v7 (186be9b)
- deps: update dependency espree to v7 (863cd0f)
chore
- drop node 8 support (b0a6731)
BREAKING CHANGES
- Node 8 support has been removed.
2.23.1 (2020-06-21)
Bug Fixes
2.23.0 (2020-05-18)
Bug Fixes
- cli:
expandFilespath normalization for windows (b902853)
Features
- config: add two new config presets
html-validate:standardandhtml-validate:a17y(36bf9ec), closes #90 - rules: add
includeandexcludeoptions toprefer-button(b046dc5), closes #90 - rules: add
isKeywordExtendedmethod for rule authors (ca7e835)
2.22.0 (2020-05-15)
Bug Fixes
- elements: add
<details>and<summary>elements (47ba673), closes #89 <legend>should allow heading elements (73e150f)- deps: update dependency json-merge-patch to v1 (e9f83d2)
Features
2.21.0 (2020-04-26)
Bug Fixes
- meta: throw schema validation error when element metadata does not validate (6ecf050), closes #81
- schema: allow
permittedContentandpermittedDescendantsto use AND-syntax (2fa742c), closes #82 - transform: expose
computeOffset(d033538)
Features
- dom:
DOMTokenListcan extract location data for each token (4f4dfe0), closes #74 - rules: add
includeandexcludeoptions tono-inline-style(6604e88), closes html-validate/html-validate-angular#3 - rules: use more precise location from
DOMTokenList(e874784)
2.20.1 (2020-04-19)
Bug Fixes
- handle loading js-files via
extendsagain (e29987f)
2.20.0 (2020-04-05)
Bug Fixes
- meta: add missing null return type to MetaTable.getMetaFor (44eac5b)
- allow loading elements from js-file again (5569a94)
- make
astproperty private (cb1a2c8)
Features
- support loading custom formatters (0b02a31)
- formatters: use factory to load formatters to make it more webpack-friendly (81bef6e)
2.19.0 (2020-03-24)
Bug Fixes
Features
- meta: implicit inheritance when overriding existing element (8833a0f)
2.18.1 (2020-03-22)
Bug Fixes
- meta: allow regexp literal in element schema (444a472), closes #70
- meta: make all meta properties optional in type declaration (eac5052)
- meta: support case-insensitive regexp flag (96e7343), closes #69
- rules: use original wcag rule names (1d5aa3c)
Reverts
- Revert "ci: temporary add debug to troubleshoot @semantic-release/gitlab" (b4d016b)
2.18.0 (2020-03-11)
Bug Fixes
- validate
input[list](9c70db2) - rules:
no-dup-idhandles when id is set but omitted value (5f678a5) - rules:
no-missing-referencesignores omitted references (b8863cd) - rules: add contextual documentation for
deprecated(7fbf433) - rules: add contextual documentation for
element-name(2a98bad) - rules: better and more contextual messages for
deprecated(3602be7) - rules: contextual documentation for
deprecated-rule(8b10601) - rules: improve documentation for
doctype-html(1a896a8) - shim: expose
ConfigErrorandUserError(2d002c7) - transform: ignore non-string values in
TemplateExtractor(7f27c8b) - allow both null and empty string when attribute allows empty values (5b6991b)
Features
2.17.1 (2020-03-02)
Bug Fixes
- disable
void-stylewhen usingtoHTMLValidatematcher (4d6bb3d)
2.17.0 (2020-02-17)
Bug Fixes
- elements:
<img>srcsetattribute cannot be empty (27699ad) - jest: typescript compatibility with jest@23 (4efae54)
- rules: add
aria-labelhelper (6d5d963) - rules: fix
deprecated-rulemissing location (1156c1e) - change config merge order in
toHTMLValidate(204a8fa) - rules: handle
aria-labelon links for WCAG H30 (eb01542), closes #67
Features
- rules: mark
voidas deprecated (f6afc0f), closes #58 - rules: new rule
no-self-closing(d9c869b), closes #58 - rules: new rule
script-element(48ad6da) - rules: new rule
script-type(a680f1d) - rules: new rule
void-content(c93c63b), closes #58 - rules: new rule
void-style(f30de03), closes #58 - allow configuration override when using
validate{String,Source}(6e62852)
2.16.0 (2020-02-12)
Bug Fixes
- cli: fix typo when using
--initwith vuejs (6eee478) - dom:
querySelectorand friends return empty when selector is empty (6a871de) - schema: add title and description to most properties (a7cea78)
- schema: handle
$schemain config and elements (a4f9054) - add missing
jest.jsandjest.d.ts(8b767c2)
Features
- add import
html-validate/jestas a shortcut to the jest matchers (4ccf6ed) - expose
NodeClosed,TextNode,PluginandParser(f344527)
2.15.0 (2020-02-09)
Features
- plugin: load
defaulttransformer if loading named transformer without name (efb0eb9)
2.14.0 (2020-02-06)
Features
- elements: make
<legend>in<fieldset>optional (covered by new h71 rule instead) (f3a59b9) - rules: new method
getTagsDerivedFromto get tag and tags inheriting from it (0118738) - rules: new rule
wcag/h71requiring<fieldset>to have<legend>(1b8ceab)
2.13.0 (2020-02-02)
Features
- meta: allow plugins to add copyable metadata (242eaa8)
2.12.0 (2020-01-27)
Bug Fixes
Features
2.11.0 (2020-01-26)
Bug Fixes
Features
- dom: add
generateSelector(12e718e) - dom: new type
DOMInternalID(ada3cd3) - dom: support pseudo-classes
:first-child,:last-childand:nth-child(af39ea1) - rules: add selector to reported errors (6b6ae3d)
- rules: improved reported error location for some rules (216b449)
- shim: expose
Report(6091050)
2.10.0 (2020-01-22)
Features
2.9.0 (2020-01-17)
Features
2.8.2 (2020-01-09)
Bug Fixes
- create directory only if missing (5db6fe8)
2.8.1 (2020-01-06)
Bug Fixes
- cli: create output directory as needed (b5569f3)
- meta: load metadata with
readFileinstead ofrequire(c5de95b)
2.8.0 (2020-01-02)
Features
- rule: validate matching case for start and end tags (288cf86)
- rules: refactor
parseStylefromelement-caseandattr-case(24d8fad) - rules: support multiple case styles (5a397bd), closes #50
- rules: support pascalcase and camelcase for
element-caserule (be7d692)
2.7.0 (2019-12-16)
Bug Fixes
- config: more helpful error when user forgot to load plugin (62bbbe5)
Features
- config: configuration schema validation (c9fe45f), closes #61
- dom: allow plugins to modify element annotation (979da57)
- dom: allow plugins to modify element metadata (cbe3e78), closes #62
- elements: make schema publicly accessible (bcab9e4)
- rules: use annotated name (1895ef4)
2.6.0 (2019-12-12)
Bug Fixes
- cli: useful error message when metadata is invalid (165da72)
- elements: allow
requiredAttributesand others to be empty array (244d038), closes #59 - error: better schema validation error (9a5f8fe)
Features
- lexer: handle rudimentary template tags such as
<% .. %>(a0f6190)
2.5.0 (2019-12-09)
Bug Fixes
- config: keep track of plugin original name (9e7ea3e)
- config: throw error is plugin is missing (bc61a6b)
- htmlvalidate: more verbose output from
--dump-source(f0089c6) - htmlvalidate: prefer html-validate:recommended (8deb03a)
Features
- htmlvalidate: new method
canValidateto test if a file can be validated (f523028)
2.4.3 (2019-12-08)
Bug Fixes
- parser: report parser-error when stream ends before required token (50e1d67)
2.4.2 (2019-12-05)
Bug Fixes
2.4.1 (2019-12-02)
Bug Fixes
- lexer: handle missing
Sourceproperties (likeoffset) (2092942)
2.4.0 (2019-12-01)
Bug Fixes
- config:
initcan now safely be called multiple times (ed46c19) - htmlvalidate: initialize global config if needed (6d05747)
Features
- htmlvalidate: retain
offsetwhen yielding multiple sources (fe1705e) - transform: add
offsetToLineColumnhelper (1e61d00)
2.3.0 (2019-11-27)
Bug Fixes
- config: update
--initconfig for html-validate-vue@2 (6553ded)
Features
- transform: support
hasChainto test if a transformer is present (e8ef4f5)
2.2.0 (2019-11-23)
Bug Fixes
- config: throw ConfigError when elements cannot be loaded (62c08e7)
- docs: update plugin docs (340d0ca)
- plugin: make all fields optional (a587239)
Features
- plugin: allow specifying name (6554f72)
2.1.0 (2019-11-21)
Bug Fixes
- deps: update dependency chalk to v3 (f84bd35)
- rules: wcag/h32 support custom form elements (e00e1ed)
Features
- meta: add method to query all tags with given property (eb3c593)
- meta: adding
formproperty (edf05b0) - meta: allow inheritance (5c7725d)
- meta: support @form category (66d75a8)
2.0.1 (2019-11-19)
Bug Fixes
- config: better error when loading missing transformer from plugin (db48a01)
- config: fix loading non-plugin transformer with plugin present (c9ad080), closes #54
2.0.0 (2019-11-17)
Features
- config: transformers must now operate on
Source(9c2112c) - config: wrap transformer error message better (9f833e9)
- htmlvalidate: string sources are now transformed too (0645e37)
- plugin: support exposing transformers from plugins (1370565)
- transform: add context object as
this(cb76cb3) - transform: add version number to API (94a5663)
- transform: adding test utils (9e42590)
- transform: support chaining transformers (4a6fd51)
- transform: support returning iterators (623b2f2)
BREAKING CHANGES
- config: Previously transformers took a filename and had to read data of
the file itself. Transformers will now receive a
Sourceinstance with the data preread.
1.16.0 (2019-11-09)
Bug Fixes
- cli: fix
--initnot creating configuration unless overwriting (9098529) - config: use
readFileto prevent unintended caching (4864bfa)
Features
- shim: expose version number in shim (890d122)
1.15.0 (2019-11-03)
Bug Fixes
- cli:
--helpdoes not take an argument (e22293f)
Features
- cli: add
--dump-sourceto debug transformers (4d32a0d) - cli: add
--initto create initial configuration (6852d30)
1.14.1 (2019-10-27)
Bug Fixes
1.14.0 (2019-10-20)
Features
- shim: expose more types (86bb78d)
- enable typescript strict mode (excect strict null) (5d2b45e)
- htmlvalidate: support passing filename to
validateString(c2e09a2)
1.13.0 (2019-10-13)
Features
- rules: support deprecating rules (de80d96)
1.12.0 (2019-10-08)
Features
- cli: new API to get validator instance (6f4be7d)
- cli: support passing options to CLI class (aa544d6)
- config: add
rootproperty to stop searching file system (9040ed5) - shim: expose HtmlElement in shim (dbb673f)
1.11.0 (2019-09-23)
Bug Fixes
- config: expand
<rootDir>in elements (eeddf4c)
Features
- meta: new property
scriptSupporting(c271a04)
1.10.0 (2019-09-19)
Features
1.9.1 (2019-09-19)
Bug Fixes
1.9.0 (2019-09-17)
Features
- rules: new rule
svg-focusable(c354364)
1.8.0 (2019-09-16)
Bug Fixes
- rules: fix prefer-button crashing on boolean type attribute (94ce2a8)
Features
- cli: allow specifying extensions (2bdd75f)
- cli: cli learned
--versionto print version number (95c6737) - cli: exit early when encountering unknown cli arguments (1381c51)
- cli: expose expandFiles function (edab9cf)
- cli: handle passing directories (f152a12)
- cli: support setting cwd when calling expandFiles (420dc88)
- event: new event config:ready (c2990b5)
1.7.1 (2019-09-15)
Bug Fixes
- config: better error message when transformer fails to load (c5a4f38)
1.7.0 (2019-09-11)
Bug Fixes
- parser: fix conditional comments pushing elements into tree (b26fe80), closes #51
- rules: attr-case no longer reports duplicate errors for dynamic attributes (c06ae67), closes #48
Features
- location: allow sliceLocation to wrap line/column (cbd7796)
- rules: add PascalCase and camelCase styles for
attr-case(9e91f81), closes #49
1.6.0 (2019-09-01)
Bug Fixes
- matchers: typo in error message (daeabba)
Features
- matchers: optionally test context (44fcf47)
1.5.1 (2019-08-20)
Bug Fixes
- elements: mark contextmenu attribute as deprecated (db4069f)
Features
- rules: new rule no-unknown-elements (96f5fcf)
1.5.0 (2019-08-17)
Bug Fixes
- elements:
<img>must have non-empty src (8916e19) - rules: change output format of wcag/h37 and element-required-attributes to match (26f5074)
Features
- cli: add --config to specify a custom configuration file (87b565f)
- elements:
<fieldset>requires<legend>(0bce9dd) - elements:
<head>requires<title>(8aaa801) - elements: src, href, etc attributes cannot be empty (89c7ac6)
- parser: include valueLocation in doctype event (803ddae)
- rules: new rule doctype-html (46061a7)
- rules: new rule element-required-content (664dead)
- rules: new rule no-style-tag (a1dff5c)
1.4.0 (2019-08-15)
Bug Fixes
- deps: update dependency acorn-walk to v7 (1fe89e0)
- reporter: fix {error,warning}Count after merging reports (bc657d0)
- reporter: require {error,warning}Count to be present in Result (b1306a4)
Features
- cli: add new --max-warnings flag (e78a1dc)
- reporter: add {error,warning}Count summary to Report object (2bae1d0)
1.3.0 (2019-08-12)
Features
- rules: new rule no-missing-references (4653384)
1.2.1 (2019-07-30)
- fix configuration when using multiple extends.
1.2.0 (2019-06-23)
- new rule
prefer-tbodyto validate presence of<tbody>in<table. - add
requiredAncestorsmetadata and validation to test elements with additional requirements for the parent elements, such as<area>and<dd>/<dt>. - add
HtmlElement.closest()to locate a parent matching the given selector. - add
HtmlElement.matches()to test if a selector matches the given element. - fix so multiple combinators can be used in selectors, e.g.
foo > bar > baznow works as expected.
1.1.2 (2019-06-18)
- allow div to group elements under dl (fixes #44).
1.1.1 (2019-06-07)
Reporteris now exposed in shim.getFormatterCLI API now returns output as string instead of writing directly to stdout.codeframeformatter now adds final newline in output.
1.1.0 (2019-06-04)
input-missing-labelnow validates<textarea>and<select>.querySelectorand friends now handles[attr="keyword-with-dashes"]and similar constructs.
1.0.0 (2019-05-12)
- rule
wcag/h37now ignores images withrole="presentationoraria-hidden="true". - allow
crossoriginattribute to be boolean or""(maps to"anonymous"). - add
<picture>element. - mark
<style>as foreign as to not trigger errors inside css content. - allow whitespace around attribute equals sign, e.g
class = "foo".
0.25.1 (2019-05-10)
- allow raw ampersands (
&) in quoted attributes. - extend set of allowed characters in unquoted attributes in lexer.
0.25.0 (2019-04-23)
- new rule
unrecognized-char-reffor validating character references. - add support for
autostyle forattr-quotesrule. - new rule
no-raw-charactersto check for presence of unescaped<,>and&characters.
0.24.2 (2019-03-31)
Features
- new rule
meta-refresh. - new event
element:readytriggered after an element and its children has been fully constructed. - add plugin callbacks
init()andsetup(). - new rule
require-sri. - add
<slot>element.
0.24.1 (2019-03-26)
Bugfixes
- fix broken edit links in footer.
- fix broken import causing typescript API users getting build errors.
0.24.0 (2019-03-26)
Features
- adding link to edit documentation and view rule source in documentation.
- new rule
wcag/h36. - new rule
wcag/h30. - new rule
long-title. - new rule
empty-title. - add
UserErrorexception which is to be used for any error which is not caused by an internal error, e.g. configuration errors or a plugin. The error suppresses the notice about internal error which should be reported as a bug. - reworked and extendable validation of elements metadata. Plugins may now add support for custom metadata.
Bugfixes
- fix handling of plugins with no rules.
0.23.0 (2019-03-20)
Features
- new rule
empty-headingvalidating headers have textual content. - let plugins add configuration presets.
- add
processElementhook onSource. - add
textContentproperty onDOMNodeto get text (recursive) from child nodes. A new node typeTextNodeis added. - add
firstChildandlastChildtoDOMNode. - docs: precompile syntax highlighting for smoother page loads.
- expose
Config,ConfigDataandConfigLoaderin shim.
0.22.1 (2019-02-25)
Breaking change
.childrenhas been split and moved fromHtmlElementtoDOMNode..childNodesreplaces the original.childrenbut is now typedDOMNode[](and in a future release may contain other node types). A getter.nodeElementscan be used to access onlyHtmlElementfrom.childNodesand is typedHtmlElement[]. If your rules use.childrenthe
Bugfixes
<rootDir>is now respected when configuring plugins.- fix cosmetic case of
wcag/h37rule.
0.22.0 (2019-02-24)
Breaking changes
HtmlElementdirect access toattris replaced withattributes. The former was an key-value object and the latter is a flattened array ofAttribute.
Features
- exposes
SourceandAttributeDatain shim. HtmlElementwill now store duplicated (or aliased) attributes. The biggest change this introduces is thatclassListwill now contain a merged list of all classes. This is needed when combining a staticclassattribute with a dynamic one.- DOM
Attributegot two flagsisStaticandisDynamicto easily tell if the value is static or dynamic. - more verbose exception when a transformer fails. (fixes #37)
- allow
processAttributehook to yield multiple attributes, typically used when adding aliased attributes such as:class. By adding both the alias and the original the latter can be validated as well (e.g.no-dup-attrcan trigger for multiple uses of:class). (fixes #36) - allow setting hooks when using
HtmlValidate.validateString, makes it easier to write tests which requires hooks, e.g. processing attributes.
Bugfixes
[attr]selector now matches boolean attributes.attribute-boolean-styleandno-dup-attrnow handles when dynamic attributes is used to alias other attributes, e.g:required="foo"no longer triggers an boolean style andclass=".."combined with:class=".."no longer triggers duplicate attributes. (fixes #35)attribute-allowed-valuesnow ignores boolean attributes with dynamic values. (partially fixes #35)
0.21.0 (2019-02-17)
Breaking changes
button-typeis replaced withelement-required-attributes.
Features
- new rule
element-required-attributesreplacesbutton-typeand allows any element to containrequiredAttributesmetadata. - support foreign elements. The body of the foreign element will be discarded from the DOM tree and not trigger any rules.
- CLI write a more verbose message when unhandled exceptions are raised.
--dump-eventsoutput reduced by hiding element metadata and compacting location data.- use jest snapshots to test element metadata as it is more maintainable.
Bugfixes
- allow
<area shape="default">(fixes #31)
0.20.1 (2019-02-06)
Bugfixes
- fix #33: ensure
wcag/h37andwcag/h67checks if node exists before testing tagname. - handle boolean attributes in
attribute-allowed-values.
0.20.0 (2019-01-29)
Features
- update
codeframeformatter to show not just start location but also end.
Bugfixes
- Fixes html-validate-angular#1 by handling both regular and arrow functions.
0.19.0 (2019-01-27)
Breaking changes
img-req-althas been renamedwcag/h37.
Features
- new rule
prefer-button. Attributenow stores location of value.- new rules
wcag/h32andwcag/h67. - move
locationandisRootElementtoDOMNodeand add newnodeTypeproperty. - add
Attribute.valueMatchesto test attribute value. HandlesDynamicValue. querySelectornow handles selector lists (comma-separated selectors)
0.18.2 (2019-01-14)
Bugfixes
- fix issue when calling
getAttributeValueon a boolean attribute. - handle
DynamicValueinDOMTokenListandid-pattern.
0.18.1 (2019-01-12)
Features
- CLI learned
--print-configto output configuration for a given file.
0.18.0 (2019-01-10)
Features
- add support for dynamic attribute values, that is the value is marked as being
set but has no known value. Rules are expected to assume the value exists and
is valid. The primary usage for this is in combination with the
parseAttributehook, e.g:id="..."can yield attributeidwith a dynamic value. - add support for transformer hooks, currently the only hook is
parseAttributeallowing the transformer to alter the attribute before any events are emitted, e.g. it can pick up the vuejs:idattribute and pass it asidto allow other rules to continue just as ifidwas typed.
Bugfixes
- fix
ConfigLoadertests when running on windows.
0.17.0 (2019-01-09)
Breaking changes
DOMNodehas been renamedHtmlElementand there is instead a new base classDOMnodewhichHtmlElementextends from. Rules usingDOMNodeneed to be changed to useHtmlElement.
Features
- use Prettier for formatting sources.
- add
HtmlValidate.getRuleDocumentation()API for IDEs to fetch contextual rule documentation. - add
codeframeformatter (from eslint). - add
HtmlValidate.flushConfigCacheto allow flushing the config loader cache. - add
TemplateExtractor.createSourceas a quick way to create a source from filename. - add typescript definition for
shim.js - add
validateSourcetoHtmlValidateallowing to manually passing a source. HtmlValidate.getConfigForis now part of public API.
Bugfixes
- Directives can now enable/disable rules working with
dom:readyevent. HtmlElementlocation is now shifted by 1.
0.16.1 (2018-12-16)
Bugfixes
Messagenow passessizeproperty fromLocation
0.16.0 (2018-12-15)
Features
Locationhas a new propertysizeholding the number of characters the location refers to.HtmlValidateclass now loads same default config as CLI if no configuration is passed explicitly.Locationhas a new propertyoffsetholding the offset into the source data (starting at zero).- CLI learned
--stdinand--stdin-filenamefor passing markup on standard input and explicitly naming it. Useful for external tools and IDEs which wants to pass the markup in stdin instead of a temporary file.
0.15.3 (2018-12-05)
Features
- expose
querySelectorandquerySelectorAllonDOMNode, not justDOMTree.
0.15.2 (2018-12-01)
Features
- move repository to https://gitlab.com/html-validate/html-validate
- move homepage to https://html-validate.org
- more element attributes added.
0.15.1 (2018-11-26)
Features
- new properties
previousSiblingandnextSiblingonDOMNode.
0.15.0 (2018-11-21)
Features
- new rule
attribute-boolean-styleto validate style of boolean attributes. - new property
nodeNameonDOMNode.
Bugfixes
attribute-allowed-valuesnow normalizes boolean attributes before validating, i.e. it will acceptdisabled,disabled=""ordisabled="disabled". Fixes #13.inputlearnedrequiredattribute.querySelectorproperly handles attribute selectors with dashes and digits. Fixes #15.
0.14.2 (2018-11-06)
Features
- bump dependencies.
- use
acorn-walkinstead ofacorn@5.
0.14.1 (2018-11-04)
Bugfixes
- fix dependency on
acorn, the package now properly resolves acorn 5 when dependant pulls acorn 6.
0.14.0 (2018-11-03)
- support global metadata.
- new rule
attribute-allowed-valuesvalidates allowed values for attributes, such astypefor<input>.
0.13.0 (2018-10-21)
Features
deprecatedsupports adding a message for custom elements.- Rule constructors can now throw exceptions. Previously the exceptions would be silently swallowed and the rule would trigger the missing rule logic.
- Support writing element metadata inline in configuration file.
Bugfixes
element-permitted-ordernow reports the error where the malplaced element is instead of the parent element (which holds the restriction). Fixes #10.
0.12.0 (2018-10-17)
Features
- Support writing plugins with custom rules.
- Bump dependencies, including typescript 3.0 to 3.1
0.11.1 (2018-10-07)
Features
- Rule documentation examples are now validated automatically with htmlvalidate to provide direct feedback of how a rule will react on the given markup.
Bugfixes
no-implicit-closenow provides more context when closed by a sibling.close-orderno longer reports error for implicitly closed elements.
0.11.0 (2018-09-23)
Breaking changes
- For compatibility with other tools the severity
disablehas been renamed tooff. The old name will continue to work but will be removed in the future.
Features
- support directives to enable/disable rules inside files, e.g. to ignore a single error.
- rules are now using dynamic severity which can change at runtime.
- new class
Attributeused byDOMNode. Attributes now holds the location they are created from making DOM attribute rules more precise. - new rule
heading-levelfor validating sequential heading levels.
Bugfixes
element-permitted-occurrencesno longer triggers for the first occurrence, only subsequent usages.Table.getMetaFor(..)is not case-insensitive.
0.10.0 (2018-08-11)
Breaking changes
- rule api overhaul, all rules are now classes.
Features
- support multiple events for single listener and listener deregistration.
- new
Engineclass for easier programmatical usage. - stricter types related to events
- bump dependencies.
Bugfixes
- add espree dependency
0.9.2 (2018-07-12)
Features
- add
no-inline-styletohtmlvalidate:recommended. - add
htmlvalidate:documentfor predefined set of document-related rules, e.g. recommended for documents but not component templates. - add
missing-doctyperule to require doctype. - add source location to root DOMNode containing the first line and column in the source file.
- add
doctypeproperty toDOMTree. - add
doctypeevent, emitted when a doctype is encountered. - add
element-caserule for validating case of element names. - add
attr-caserule for validating case of attributes.
0.9.1 (2018-07-01)
Features
- add
protractor-html-validateto docs.
0.9.0 (2018-06-17)
Breaking changes
- semantics for
requirechanged fromrequire('html-validate')torequire('html-validate').HtmlValidateto support exposing other classes.
Features
- new
TemplateExtractorhelper class for extracting templates from javascript sources. - trigger downstream projects on release
Bugfixes
- Report
validnow only checks for errors, the result will still be valid if only warnings are present.
0.8.3 (2018-06-12)
- run tests against multiple node versions (8.x, 9.x and 10.x) to ensure compatibility.
- exposed
getFormatteras a reusable function to load formatters from string (like CLI tool):name[=DST][,name=DST...]
0.8.2 (2018-05-28)
Bugfixes
- lexer better handling of newlines, especially CRLF
\r\n.
0.8.1 (2018-05-27)
Misc
- update
package.json
0.8.0 (2018-05-27)
Features
- easier API usage:
require('html-validate')now returns class without usingrequire(html-validate/build/htmlvalidate').default. - support
transformin configuration to extract source html from other files. - attach
depthanduniqueread-only properties toDOMNodecorresponding to the nodes depth in the DOM tree and a sequential id (unique for the session). - new rule
no-conditional-commentsto disallow usage of conditional comments. - handle conditional comments.
Bugfixes
- handle whitespace before doctype
- DOMTokenlist now handles multiple spaces as delimiter and strip leading/trailing whitespace.
0.7.0 (2017-11-04)
Features
- new rule
no-implicit-closeto disallow usage of optional end tags. - handle optional end tags.
- better result sorting, error messages are now sorted by line and column, the stage which triggered the error doesn't matter any longer.
- better result merging, files will no longer be duplicated.
- element metadata can no be sourced from multiple sources and be configured
using the
elementsconfiguration property.
Improvements
- better configuration merging
Bugfixes
- fixed script tag incorrectly consuming markup due to greedy matching.
0.6.0 (2017-10-29)
Features
- new rule
no-deprecated-attrfor testing if any deprecated attributes is used. - CLI supports globbing (as fallback if shell doesn't expand the glob already)
Bugfixes
- fix lowercase
<!doctype html>crashing the lexer. - fix node binary name in shebang
- fix directory traversal on windows
0.5.0 (2017-10-17)
Features
- Rule
element-namelearnedwhitelistandblacklistoptions. - Support outputting to multiple formatters and capturing output to file.
- checkstyle formatter. Use
-f checkstyle.
0.4.0 (2017-10-17)
Features
- new rule
no-inline-styledisallowing inlinestyleattribute. - new rule
img-req-altvalidating that images have alternative text. - new rule
element-permitted-ordervalidating the required order of elements with restrictions. - new rule
element-permitted-occurrencesvalidating elements with content models limiting the number of times child elements can be used.
Bugfixes
- the parser now resets the DOM tree before starting, fixes issue when running the same parser instance on multiple sources.
0.3.0 (2017-10-12)
Features
- new rules
id-patternandclass-patternfor requiring a specific formats. - new rule
no-dup-classpreventing duplicate classes names on the same element.
Bugfixes
- lexer now chokes on
<ANY\n<ANY></ANY></ANY>(first tag missing>) instead of handling the inner<ANY>as an attribute. element-permitted-contentfixed issue where descending with missing metadata would report as disallowed content.
0.2.0 (2017-10-11)
Features
- Support putting configuration in
.htmlvalidate.jsonfile. voidrule rewritten to better handle both tag omission and self-closing. It learned a new optionstyleto allow a single style.- new rule
element-permitted-contentverifies that only allowed content is used. - new rule
element-nameto validate custom element names.
0.1.3 (2017-10-08)
Features
- Rule documentation
Bugfixes
no-dup-attrnow handles attribute names with different case.