Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

html-validate

Package Overview
Dependencies
Maintainers
1
Versions
259
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-validate - npm Package Versions

1
26

8.1.0

Diff

Changelog

Source

8.1.0 (2023-07-22)

Features

  • rules: new rule no-redundant-aria-label (59b5bab), closes #206

Bug Fixes

  • add compatibilityCheck function to browser bundle (b89dcc2)
  • api: remove unintended null return value from plugins api (0eb0ea8)
ext
published 8.0.5 •

Changelog

Source

8.0.5 (2023-06-13)

Bug Fixes

  • fix import issue with elements/html5.js (0604c21), closes #219
  • make elements/html5 work with esm (d95de27)
ext
published 8.0.4 •

Changelog

Source

8.0.4 (2023-06-12)

Bug Fixes

ext
published 8.0.3 •

Changelog

Source

8.0.3 (2023-06-12)

Bug Fixes

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

Changelog

Source

8.0.2 (2023-06-10)

Bug Fixes

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

Changelog

Source

8.0.1 (2023-06-10)

Bug Fixes

  • fix nodejs code being included in browser bundle (7c76a3b)
ext
published 8.0.0 •

Changelog

Source

8.0.0 (2023-06-04)

⚠ 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)
ext
published 7.18.1 •

Changelog

Source

7.18.1 (2023-06-04)

Bug Fixes

  • cli: error message on missing --config file (e948a18)
ext
published 7.18.0 •

Changelog

Source

7.18.0 (2023-05-24)

Features

  • add new preset html-validate:prettier (9491016), closes #215

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)
ext
published 7.17.0 •

Changelog

Source

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)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc