Huge News!Announcing our $40M Series B led by Abstract Ventures.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

An HTML linter for all markup developers

  • 4.11.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
39K
increased by3.25%
Maintainers
1
Weekly downloads
 
Created
Source

markuplint

npm version Downloads Test Coverage Status GitHub Stars Follow us on Twitter

Peace of mind in your markup - An HTML linter for all markup developers.

Features

  • Conformance checking according to HTML Standard, WAI-ARIA, ARIA in HTML, etc.
  • Supports CSS and SVG values.
  • Supports React, Vue, Svelte, Alpine.js, HTMX, Pug, PHP, and more.
  • Possible to specify the rule for each element if you use CSS Selector.
  • Potential to create a custom rule.

Screenshot: Violation Report CLI output

Instant using

$ npx markuplint target.html

Supported for Node.js v18.18.0 or later.

Usage

Initialization

Create a configuration file and install dependencies.

$ npx markuplint --init
# or
$ yarn run markuplint --init

Answer questions interactively. By doing this, needed modules are installed, including markuplint.

Add a command to the scripts option on package.json:

{
  "scripts": {
    "lint:html": "markuplint **/*.html"
  }
}

If you want to change the target path, you can change it for your project.

Execute the script:

$ npm run lint:html
# or
$ yarn lint:html

Command line options

$ npx markuplint --help

Usage
	$ markuplint <HTML file paths (glob format)>
	$ <stdout> | markuplint

Options
	--config,                -c FILE_PATH  A configuration file path.
	--fix,                                 Fix HTML.
	--format,                -f FORMAT     Output format. Support "JSON", "Simple", "GitHub" and "Standard". Default: "Standard".
	--no-search-config                     No search a configure file automatically.
	--ignore-ext                           Evaluate files that are received even though the type of extension.
	--no-import-preset-rules               No import preset rules.
	--locale                               Locale of the message of violation. Default is an OS setting.
	--no-color,                            Output no color.
	--problem-only,          -p            Output only problems, without passeds.
	--allow-warnings                       Return status code 0 even if there are warnings.
	--allow-empty-input                    Return status code 1 even if there are no input files.
	--show-config                          Output computed configuration of the target file. Supports "details" and empty. Default: empty.
	--verbose                              Output with detailed information.
	--include-node-modules                 Include files in node_modules directory. Default: false.
	--severity-parse-error                 Specifies the severity level of parse errors. Supports "error", "warning", and "off". Default: "error".

	--init                                 Initialize settings interactively.
	--search                               Search lines of codes that include the target element by selectors.

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

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

Documentation

Playground

Editor Extensions

License

FOSSA Status

Sponsors

Corporate Sponsors

Velc

Personal Supporters

Tokitake Okuto Oyama miita Yasuo Fukuda shamokit takanorip

Need Sponsors❤️‍🔥

Thanks

This linter is inspired by:

FAQs

Package last updated on 04 Dec 2024

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