New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

markuplint

Package Overview
Dependencies
Maintainers
1
Versions
293
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markuplint

HTML linter for legacy/modern HTML, Web Components, SVG, MathML, AMP HTML and more.

  • 0.19.0
  • npm
  • Socket score

Version published
Weekly downloads
21K
decreased by-34.55%
Maintainers
1
Weekly downloads
 
Created
Source

markuplint

npm version Build Status Coverage Status

HTML linter for legacy/modern HTML, Web Components, SVG, MathML, AMP HTML and more.

Install

$ yarn add markuplint

Usage

CLI

$ markuplint verifyee.html
$ markuplint --help

Usage
	$ markuplint <HTML file>
	$ <stdout> | markuplint

Options
	--ruleset,  -r          Ruleset file path.
	--no-color, -c          Output no color.
	--format,   -f FORMAT   Output format. Support "JSON" only. Default "JSON".

	--help,     -h          Show help.
	--version,  -v          Show version.

Examples
	$ markuplint verifyee.html --ruleset path/to/.markuplintrc
	$ cat verifyee.html | markuplint

API

import * as markuplint from 'markuplint';

const reports = await markuplint.verify(html, ruleset, rules);
// or
const { html, reports } = await markuplint.verifyFile(htmlPath, ruleset, rules);

Configuration

.markuplintrc JSON or YAML format

{
  "extends": "markuplint/html-ls",
  "rules": {
    "rule-name": true,
    "rule-name2": false,
    "rule-name3": ["error", "VALUE"],
    "rule-name4": ["warning", "VALUE", { "OPTIONAL_PROP": "OPTIONAL_VALUE" }]
  },
  "nodeRules": [
    {
      "tagName": "div",
      "rules": {
        "rule-name": false,
      }
    }
  ],
  "childNodeRules": [
    {
      "selector": "[data-attr^=\"value\"]",
      "inheritance": true,
      "rules": {
        "rule-name3": ["warning", "ANOTHER_VALUE"],
      }
    }
  ]
}

Rules

Rule Documentation (日本語)

Custom Rule Documentation

Editor Extensions

Thanks

This linter is inspired by

FAQs

Package last updated on 02 Feb 2018

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