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

@hdot/validate

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hdot/validate

Validate HTML attributes based on the HTML spec

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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);

FAQs

Package last updated on 28 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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