0.0.7 • Published 2 years ago

@hdot/validate v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

hdot plugin: Attribute Validation

Automatically type check HTML attributes against the HTML spec, powered by markuplint.

Installation

npm i @hdot/plugins/validate

Usage

import validate from "@hdot/plugins/validate";
import { h, setPlugins } from "hdot";

setPlugins(h, [validate]);

h.div.id("my id")();
// ---> Error: 'my id' is not a valid DOMID.

Disabling in Production

If you running hdot in the browser, this plugin should typically not be used in production. Doing so will increase your bundle size.

If your build environment supports NODE_ENV, you might do the following:

import { h, setPlugins } from "hdot";
const plugins = [];

if (process.env.NODE_ENV === "development") {
  const { default: validate } = await import("@hdot/plugins/validate");
  plugins.push(validate);
}

setPlugins(h, plugins);
0.0.3

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago