Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency html-validate to v9 #332

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 23, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
html-validate (source) ^7.0.0 -> ^9.0.0 age adoption passing confidence

Release Notes

html-validate/html-validate (html-validate)

v9.0.1

Compare Source

Bug Fixes
  • fix validateMultipleFiles incorrectly using sync API (0c26918)

v9.0.0

Compare Source

ESM support has finally landed in HTML-Validate V9!

  • Configuration files (using .htmlvalidate.mjs or when "type" is "module" in package.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
  • 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.

  • api: Config.merge(..) will return a Promise when used with an
    async loader or resolver.

  • config: This change affects all users. The following deprecated
    configuration presets has been removed:

    • htmlvalidate:recommended
    • htmlvalidate:document
    • html-validate:a17y
  • 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.

refactor(cli): use ESM in CLI

  • deps: Requires NodeJS v18 or later.
  • api: The deprecated tag:open and tag:close events has been
    removed, use tag:begin and tag:end instead.
  • api: The 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.

  • api: The 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();
  • api: If you are writing your own transformers they may now
    optionally return a 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.

  • 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 CLI class most methods are now async and
    returns Promise. There is no synchronous version of these API calls.
  • api: Config.fromFile(..) and Config.fromObject(..) will return a
    Promise when used with an async loader or resolver.
  • api: ConfigLoader methods can optionally return a Promise for
    async operation. For most use-cases this will not require any changes.
  • api: The ConfigLoader.globalConfig property has been replaced with
    ConfigLoader.getGlobalConfig() (async) and
    ConfigLoader.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: CLI methods async and return Promise (677c73e)
  • api: Config.fromFile and Config.fromObject can return Promise (b126361)
  • api: Config.merge(..) can return Promise (cccb313)
  • api: Config.resolve() can return Promise (09159f3)
  • api: ConfigLoaders can optionally return Promise for async operation (6041581)
  • api: FileSystemConfigLoader uses esmResolver by default (dd4cfb1)
  • api: HtmlValidate.getConfigurationSchema() returns promise (f10ec1a)
  • api: allow transformers to return single source (fd126da)
  • api: new esmResolver using import(..) (available for both nodejs and browser) (81b4777), closes #​230
  • api: remove deprecated Config.init() (0bd8ab7)
  • api: remove deprecated tag:open and tag:close events (88ac65e)
  • api: replace ConfigLoader.globalConfig with ConfigLoader.getGlobalConfig() (a64935a)
  • api: resolvers may optionally return Promise for async operation (fe3c6a6)
  • api: transformers may optionally return Promise for async operation (823da19)
  • cli: cli uses esm (with esmResolver) (3e4759e)
  • config: remove deprecated configuration presets (dbf5cf4)
  • config: support .htmlvalidate.mjs configuration files (0ffd9b5), closes #​125
  • deps: require node 18 or later (d4f3bcb)
  • meta: remove deprecated property expressions (a77043c)

v8.29.0

Compare Source

Features
  • config: allow to specify transformer function directly in config (df2c752)
  • meta: allow labelable property to be a callback (8204b5b)

v8.28.0

Compare Source

Features
  • refactor jest and vitest toHTMLValidate(..) matcher (a6a60ab)

v8.27.0

Compare Source

Features

v8.26.0

Compare Source

Features
  • better handling of mismatched/unclosed tags (489ccae), closes #​272

v8.25.1

Compare Source

Bug Fixes
  • fix dump tree output with nested elements (854c274)

v8.25.0

Compare Source

Features
  • cli: add --preset to set preset when using cli (2ec038f), closes #​269
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)

v8.24.2

Compare Source

Bug Fixes
  • add default environment to package.json exports (a21a1ef), closes #​265

v8.24.1

Compare Source

Bug Fixes
  • dont validate quotes in dynamically added attributes (2125d86)

v8.24.0

Compare Source

Features
  • new html-validate:browser configuration preset (f4e6f5b), closes #​261

v8.23.0

Compare Source

Features
  • deps: support vitest v2 (860b0c0)

v8.22.0

Compare Source

Features
Bug Fixes
  • deps: update dependency ignore to v5.3.2 (9d86e68)

v8.21.0

Compare Source

Features
  • api: add DOMTree.readyState (1f6f69b)
  • api: deprecate DOMTree.find(..) in favour of querySelector(..) (ac0bb77)
  • api: internal methods of DOMTree removed from public API (79a03be)
  • api: new walk.depthFirst(..) API to replace now deprecated DOMTree.visitDepthFirst(..) method (f9dbda0)
Bug Fixes
  • html5: spellcheck is a global attribute (46594a1)

v8.20.1

Compare Source

Bug Fixes
  • rules: fix attribute-allowed-values error location for empty values (2c04eeb)

v8.20.0

Compare Source

Features
  • api: new setConfig method on StaticConfigLoader to change config (1bf7559)
  • api: new getter/setter for configuration loader (6283091)

v8.19.1

Compare Source

Bug Fixes
  • rules: wcag/h36 no longer reports for hidden elements (aba06d1)
  • rules: wcag/h37 no longer validates <input type="submit"> (use wcag/h36 instead) (e82b17a), closes #​254
  • rules: make wcag/h36 have better message and location (8a80cc8)

v8.19.0

Compare Source

Features
  • rules: new option allowCheckboxDefault for form-dup-name (293b951), closes #​251
Bug Fixes
  • rules: multiple-labeled-controls handles hidden input (4d794b6), closes #​251
  • rules: wcag/h30 only applies to <a href> (cd93dfe), closes #​252
  • rules: handle unicode letters in valid-id (c83687a), closes #​253

v8.18.2

Compare Source

Bug Fixes
  • html5: allow textarea to have autocomplete values other than on and off (c1dfbb1), closes #​249

v8.18.1

Compare Source

Bug Fixes
  • rules: form-dup-name handles <template> element (9c77444), closes #​247
  • rules: no-dup-id handles <template> element (04f3e0d), closes #​247

v8.18.0

Compare Source

Features
  • rules: new pattern bem for pattern rules (c1ead1b)
  • rules: new pattern snakecase for 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)

v8.17.1

Compare Source

Bug Fixes
  • rules: properly handle inert on ancestor elements (2990669), closes #​243

v8.17.0

Compare Source

Features
  • rules: new rule name-pattern (f2209c0), closes #​216
  • rules: support multiple patterns in id-pattern, class-pattern and name-pattern rules (15dd007)
Bug Fixes
  • meta: handle regexp with slash inside (4c88396), closes #​242
  • rules: input-missing-label now ignores <input> hidden by css (c40e48e), closes #​241
  • rules: input-missing-label now tests if <label> is inert or hidden by css (d0d6f40)
  • rules: show pattern name in id-pattern, class-pattern and name-pattern rules (4bd70ab)

v8.16.0

Compare Source

Features
  • api: new tabIndex property reflecting the parsed tabindex attribute (a4e5d5b)
  • meta: add inert as global attribute (a5e6477)
  • meta: new formAssociated.disablable property (0b141ab)
Bug Fixes
  • html5: <summary> element is focusable if child of <details> (79dec74)
  • rules: hidden-focusable handles inert elements (89bb969), closes #​240
  • rules: hidden-focusable no longer reports for disabled form controls (d337397)
  • rules: hidden-focusable no longer reports for elements with tabindex="-1" (03d7223), closes #​240

v8.15.0

Compare Source

Features
  • rules: new rule valid-autocomplete (bebd0d1)
Bug Fixes
  • rules: case-insensitive match for url in meta-refresh (3177295)

v8.14.0

Compare Source

Features
  • rules: new option allowLongDelay to meta-refresh to allow 20h+ delays (629625c)

v8.13.0

Compare Source

Features
  • meta: allow <link> under <body> if appropriate rel attribute is present (ae1e070)
  • meta: allow content categories to be a callback (0eb4e77)
  • meta: disallow invalid rel attribute keywords (dc36cfb)

v8.12.0

Compare Source

Features
  • rules: new rule no-abstract-role (923680b)

v8.11.1

Compare Source

Bug Fixes
  • dom: fix regression error with selectors ending with characters a, d or 9 (a9a9ef9)

v8.11.0

Compare Source

Features
  • html5: add new property aria.naming representing if the element can be named (4fca264)
  • html5: update role metadata from html-aria standard (b029a3f)
  • meta: move implicitRole to aria.implicitRole (bc8cacf)
Bug Fixes
  • handle selectors containing tabs and newlines (5e45d54), closes #​238
  • rules: new option allowAnyNamable for aria-label-misuse (c08a3ba), closes #​237

v8.10.0

Compare Source

Features
  • rules: new rule no-implicit-input-type (6cc0c6d)
Bug Fixes
  • deps: update dependency ignore to v5.3.1 (4553b89)
  • html5: type for <input> no longer required (37284d0), closes #​235
  • rules: change wording required to recommended in no-implicit-button-type (1926c06)

v8.9.1

Compare Source

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

v8.9.0

Compare Source

Features
  • elements: new property focusable to mark elements as focusable (c59c8b2)
  • rules: new rule hidden-focusable (243e7fb)
  • rules: new rule unique-landmark (187be1e)
Bug Fixes
  • api: remove internal listeners property 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 for role="presentation" (b1d7b50)
  • dom: interactive and focusable elements ignore role="presentation" (017308f)
  • rules: better error description for require-sri (ffc3695)
  • rules: rule wcag/h30 no longer requires text on <a hidden> (a20cc84)
  • rules: rule wcag/h30 no longer requires text on links with display: none or visibility: hidden (36ff07e)
  • rules: rules wcag/h32 handles <button> without explicit type (84c6a6e)

v8.8.0

Compare Source

Features
  • api: Report.merge() can merge async results (35689fc)
  • api: rename nodejsResolver to cjsResolver (8c72c8f)
  • config: new defineConfig helper (35e265a)
Bug Fixes
  • config: proper error message when certain configuration properties was invalid (b029569)

v8.7.4

Compare Source

Bug Fixes

v8.7.3

Compare Source

Bug Fixes
  • disable doctype-style when using prettier preset (f1f4004)

v8.7.2

Compare Source

Bug Fixes
  • deps: update dependency ignore to v5.3.0 (143e994)

v8.7.1

Compare Source

Bug Fixes
  • rules: fix form-dup-name issue when more than two names are present in array (5d9ff3b), closes #​228

v8.7.0

Compare Source

Features
  • html5: support referrerpolicy attribute (851b559)

v8.6.1

Compare Source

Bug Fixes
  • dom: remove usage of regex negative lookbehind (f406393), closes #​147
  • rules: improve attribute-misuse error message (fccce69), closes #​226
  • typo in CONTRIBUTING.md (855bacf)

v8.6.0

Compare Source

Features
  • api: add meta: MetaAttribute in AttributeEvent (2cda0ae)
  • cli: --rule severity can now be set with strings, fixes #​225. (054972e)

v8.5.0

Compare Source

Features

v8.4.1

Compare Source

Bug Fixes
  • rules: fix contextual documentation for attr-pattern rule (0082aef)

v8.4.0

Compare Source

Features
  • html5: support <search> element (720bdd9)
  • new implicitRole metadata for better handling of implicit ARIA roles (fe45ec4), closes #​224

v8.3.0

Compare Source

Features
Bug Fixes
  • html5: <label> cannot have empty for (3626e1a), closes #​223
  • html5: element-required-attributes allows <button> without type (use no-implicit-button-type instead) (d32f492), closes #​221

v8.2.0

Compare Source

Features
  • add allowedIfParentIsPresent metadata helper (2668899)
  • html5: add <source> attributes metadata (e3a3311)
  • support passing native HTMLElement to metadata helpers (8af6d01), closes #​207
Bug Fixes
  • api: typing for Rule.setSeverity() changed to only accept Severity (64f4210)

v8.1.0

Compare Source

Features
Bug Fixes
  • add compatibilityCheck function to browser bundle (b89dcc2)
  • api: remove unintended null return value from plugins api (0eb0ea8)

v8.0.5

Compare Source

Bug Fixes
  • fix import issue with elements/html5.js (0604c21), closes #​219
  • make elements/html5 work with esm (d95de27)

v8.0.4

Compare Source

Bug Fixes
  • add explicit node import (73f9a1f)

v8.0.3

Compare Source

Bug Fixes
  • fix regression bug when using elements in extended configuration files and plugins (6892083)
  • use correct dts when using custom conditions (1b6971e)

v8.0.2

Compare Source

Bug Fixes
  • add browser condition for main import (d2f7a74)
  • remove usage of node:path and process in browser build (2580aeb)

v8.0.1

Compare Source

Bug Fixes
  • fix nodejs code being included in browser bundle (7c76a3b)

v8.0.0

Compare Source

⚠ BREAKING CHANGES

See {@​link migration migration guide} for details.

  • api: The ConfigFactory parameter to ConfigLoader (and its child
    classes StaticConfigLoader and FileSystemConfigLoader) 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 getContextualDocumentation replaces the now deprecated
    getRuleDocumentation method. The context parameter to getRuleDocumentation
    is 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 Config class. Additionally when using the
    StaticConfigLoader no modules will be resolved using require(..) 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 - uses require(..)
  • StaticResolver - uses a predefined set of items.
  • api: The HtmlValidate class now has a Promise based 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: ConfigLoader must return ResolvedConfig. 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 TemplateExtractor class has been moved to the
    @html-validate/plugin-utils package. This change only affects API users who
    use the TemplateExtractor class, typically this is only used when writing
    plugins.
  • config: Deprecated severity alias disabled removed. If you use this in your
    configuration you need to update it to off.
 {
   "rules": {
-    "my-awesome-rule": "disabled"
+    "my-awesome-rule": "off"
   }
 }
  • rules: The void rule has been removed after being deprecated a long
    time, it is replaced with the separate void-content, void-style and
    no-self-closing rules.
  • deps: minimum required node version is v16
  • deps: minimum required jest version is v27
Features
  • api: ConfigLoader must return ResolvedConfig (d685e6a)
  • api: FileSystemConfigLoader supports passing a custom fs-like object (fac704e)
  • api: add Promise based API to HtmlValidate class (adc7783)
  • api: add Resolver classes as a mean to separate fs from browser build (3dc1724)
  • api: new getContextualDocumentation to replace getRuleDocumentation (60c9a12)
  • api: remove ConfigFactory (e309d89)
  • api: remove TemplateExtractor in 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 void rule (3e727d8)
Bug Fixes
  • config: remove deprecated severity alias disabled (6282293)

v7.18.1

Compare Source

Bug Fixes
  • cli: error message on missing --config file (e948a18)

v7.18.0

Compare Source

Features
Bug Fixes
  • api: mark Config.fromFile() as internal (3e70028)
  • api: mark Config.getMetaTable() as internal (8cb6dd0)
  • api: mark dumpEvents,dumpSource, dumpTokens and dumpTree as internal (866f219)
  • jest: toMatchCodeframe and toMatchInlineCodeframe handles async result (584c67e)

v7.17.0

Compare Source

Features
  • allow to specify plugins inline in configuration (6ba1467)
Bug Fixes
  • rules: allow custom elements to use aria-label (513a813)

v7.16.0

Compare Source

Features
  • api: ConfigLoader returns a ResolvedConfig (1fd8b73)
Dependency upgrades

v7.15.3

Compare Source

Bug Fixes
  • api: remove unused url import (a2017ff)

v7.15.2

Compare Source

Bug Fixes
  • api: fix typescript not finding type declarations (0950bb9), closes #​217
  • rules: form-dup-name defaults to allow <button type="submit"> to share name (b39b9ad), closes #​212
Dependency upgrades
  • deps: update dependency glob to v10 (1855cf0)

v7.15.1

Compare Source

Bug Fixes
  • add missing exports (7fb141d)
  • fix html-validate/test-utils entrypoint (62fbee3)
  • include tsdoc-metadata.json (61dd7dd)

v7.15.0

Compare Source

Features
Bug Fixes
  • dom: querySelector typescript declaration returns null to match implementation (9c9befe)
  • fix browser entrypoint for older bundlers (c8320ba)

v7.14.0

Compare Source

Features
  • rules: add [role="alertdialog"] as a default sectioning root for heading-level (b87581a)
Bug Fixes
  • cli: fix glob pattern when file extension list is empty (d95a418)
Dependency upgrades
  • deps: update dependency glob to v9 (effd3bc)

v7.13.3

Compare Source

Bug Fixes
  • rules: check for empty alt tag in wcag/h37 (5f3b43f), closes #​209

v7.13.2

Compare Source

Bug Fixes
  • add button and reset types to form-dup-name shared options (d6ef9f8)

v7.13.1

Compare Source

Bug Fixes
  • no-unused-disable properly reports location when more than two rules are disabled (26d1970)
  • allow no-unused-disable to be disabled by directive (b11166c)

v7.13.0

Compare Source

Features

v7.12.2

Compare Source

Bug Fixes
  • form-dup-name validate checkboxes by default (d5e7b7d), closes #​202
  • add allowArrayBrackets option to form-dup-name rule (a43ea0b), closes #​203
  • add shared option to form-dup-name to set which controls allow shared names (7ddc02b), closes #​201

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants