MCPcopy
hub / github.com/htmlhint/HTMLHint

github.com/htmlhint/HTMLHint @v1.9.2 sqlite

repository ↗ · DeepWiki ↗ · release v1.9.2 ↗
141 symbols 406 edges 129 files 3 documented · 2%
README

Logo HTMLHint HTMLHint

The static code analysis tool you need for your HTML.

npm Version Open Source Security Foundation (OpenSSF) best practices: Passing npm count MIT License

How To UseContributingWebsite

Table of Contents

📟 Installation and Usage

There are two ways to install HTMLHint: globally and locally.

Local Installation and Usage

In case you want to include HTMLHint as part of your project, you can install it locally using npm:

npm install htmlhint --save-dev

After that, You can run HTMLHint on any file or directory like this:

./node_modules/.bin/htmlhint www/index.html
./node_modules/.bin/htmlhint www/**/*.html

Or, you can use HTMLHint linter programmatically, like this:

import { HTMLHint } from 'htmlhint'
const htmlVerificationHints = HTMLHint.verify(localHtmlContent)
console.log('htmlVerificationHints', htmlVerificationHints) // this logs a list of `Hint`s which contain information on all linting errors

Global Installation and Usage

If you want to make HTMLHint available to tools that run across all of your projects, you can install HTMLHint globally using npm:

npm install htmlhint -g

After that, you can run HTMLHint on any file like this:

htmlhint www/index.html
htmlhint www/**/*.html

You can even launch HTMLHint to analyze an URL:

htmlhint https://htmlhint.com/

📃 Example output

🔧 Configuration

Search .htmlhintrc file in current directory and all parent directories:

htmlhint
htmlhint test.html

Custom config file:

htmlhint --config htmlhint.conf test.html

Custom rules:

htmlhint --rules tag-pair,id-class-value=underline index.html

Inline rules in test.html:


<html>
  <head>
    ...
  </head>
</html>

📙 Docs

  1. How to use
  2. All Rules
  3. Changelog
  4. How to Develop

© License

MIT License

💪🏻 Contributors

This project exists thanks to all these people. Contribute. HTMLHint Contributors

🏅 Backers

Thank you to all our backers! Become a backer.

Backers

🎖 Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Become a sponsor.

Sponsor

Extension points exported contracts — how you extend this code

FormatOptions (Interface)
(no doc)
src/core/core.ts
FormatterFileEvent (Interface)
(no doc)
src/cli/formatter.ts
Rule (Interface)
(no doc)
src/core/types.ts
FormatterConfigEvent (Interface)
(no doc)
src/cli/formatter.ts
Ruleset (Interface)
(no doc)
src/core/types.ts
FormatterEndEvent (Interface)
(no doc)
src/cli/formatter.ts
Hint (Interface)
(no doc)
src/core/types.ts
Formatter (Interface)
(no doc)
src/cli/formatter.ts

Core symbols most depended-on inside this repo

verify
called by 310
src/core/core.ts
addListener
called by 61
src/core/htmlparser.ts
parse
called by 40
src/core/htmlparser.ts
warn
called by 38
src/core/reporter.ts
error
called by 37
src/core/reporter.ts
on
called by 26
src/cli/formatter.ts
getMapAttrs
called by 15
src/core/htmlparser.ts
removeListener
called by 7
src/core/htmlparser.ts

Shape

Function 98
Method 25
Interface 11
Class 6
Enum 1

Languages

TypeScript100%

Modules by API surface

src/cli/htmlhint.ts16 symbols
src/core/htmlparser.ts14 symbols
src/cli/formatter.ts10 symbols
src/core/core.ts8 symbols
src/core/reporter.ts7 symbols
src/core/types.ts6 symbols
src/core/rules/h1-require.ts4 symbols
src/core/rules/title-require.ts3 symbols
src/core/rules/main-require.ts3 symbols
src/core/rules/head-script-disabled.ts3 symbols
src/core/rules/doctype-html5.ts3 symbols
test/htmlparser.spec.js2 symbols

Dependencies from manifests, versioned

@astrojs/starlight0.37.6 · 1×
@rollup/plugin-commonjs28.0.6 · 1×
@rollup/plugin-node-resolve16.0.3 · 1×
@rollup/plugin-terser0.4.4 · 1×
@types/async3.2.25 · 1×
@types/is-glob4.0.4 · 1×
@types/xml1.0.11 · 1×
@typescript-eslint/eslint-plugin8.44.0 · 1×
@typescript-eslint/parser8.44.0 · 1×
astro5.18.0 · 1×
async3.2.6 · 1×
chalk4.1.2 · 1×

For agents

$ claude mcp add HTMLHint \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact