{"id":26263,"library":"remark-lint-no-html","title":"remark-lint-no-html","description":"A remark-lint rule that warns when raw HTML is used in Markdown documents. Version 4.0.1 is the current stable release, compatible with Node.js 16+. It is part of the remark-lint monorepo, which is maintained by the unified collective and releases updates alongside other lint rules. This rule helps enforce a pure Markdown writing style by disallowing inline HTML elements and comments, with an option to allow or disallow HTML comments. It is ESM-only and ships TypeScript types.","status":"active","version":"4.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","html","lint","remark","remark-lint","remark-lint-rule","rule","typescript"],"install":[{"cmd":"npm install remark-lint-no-html","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-no-html","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-no-html","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Unified is the core processing pipeline; remark-lint-no-html is a unified plugin.","package":"unified","optional":false},{"reason":"remark-lint-no-html is a rule for remark-lint and requires remark-lint to be set up.","package":"remark-lint","optional":false},{"reason":"Required to parse Markdown input when using the API.","package":"remark-parse","optional":true},{"reason":"Required to stringify Markdown output when using the API.","package":"remark-stringify","optional":true}],"imports":[{"note":"This package is ESM-only since version 4 and does not provide a CommonJS export. Use import syntax.","wrong":"const remarkLintNoHtml = require('remark-lint-no-html')","symbol":"remarkLintNoHtml","correct":"import remarkLintNoHtml from 'remark-lint-no-html'"},{"note":"Options is a TypeScript type, not a runtime value. Use import type for type-only imports.","wrong":"import { Options } from 'remark-lint-no-html'","symbol":"Options","correct":"import type { Options } from 'remark-lint-no-html'"},{"note":"The package exports a single default function. Named import is not supported and will result in undefined.","wrong":"import { remarkLintNoHtml } from 'remark-lint-no-html'","symbol":"remarkLintNoHtml (default export)","correct":"import remarkLintNoHtml from 'remark-lint-no-html'"}],"quickstart":{"code":"import { unified } from 'unified';\nimport remarkParse from 'remark-parse';\nimport remarkLint from 'remark-lint';\nimport remarkLintNoHtml from 'remark-lint-no-html';\nimport remarkStringify from 'remark-stringify';\nimport { reporter } from 'vfile-reporter';\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintNoHtml, { allowComments: false })\n  .use(remarkStringify)\n  .process('<h1>Hello</h1> <!-- comment -->');\n\nconsole.error(reporter(file));\n// 1:1-1:20: Unexpected HTML, use markdown instead\n// 1:21-1:34: Unexpected HTML, use markdown instead","lang":"typescript","description":"Shows how to set up a unified pipeline with remark-lint-no-html, disallowing HTML comments, and process a Markdown string."},"warnings":[{"fix":"Switch to dynamic import() or migrate to an ESM project. Older versions can use require('remark-lint-no-html')","message":"Version 4 is ESM-only, dropping CommonJS support.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use `allowComments` (boolean).","message":"The option `allowComments` was renamed from `allowComment` in a previous version? (Not documented but check changelog).","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Add 'remark-lint-no-html' to your plugin list in unified or remark-cli config.","message":"This rule is not included in any default remark-lint preset; you must add it manually.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Convert your project to ESM (set type:module in package.json) or use dynamic import() with .cjs extension.","cause":"The package is ESM-only (v4+), but you are using require() to load it in a CommonJS module.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/remark-lint-no-html/index.js from /path/to/project not supported."},{"fix":"Use default import: import remarkLintNoHtml from 'remark-lint-no-html'","cause":"Attempted named import: import { remarkLintNoHtml } from 'remark-lint-no-html'. The package has no named export; only default export.","error":"TypeError: remarkLintNoHtml is not a function"},{"fix":"Install with npm install remark-lint-no-html and ensure import path is correct.","cause":"Package not installed or incorrect import path (e.g., missing .js extension in ESM).","error":"Cannot find module 'remark-lint-no-html'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}