{"id":26249,"library":"remark-lint-no-empty-image-alt-text","title":"remark-lint-no-empty-image-alt-text","description":"A remark-lint rule that warns when image alt text is missing or empty, promoting accessibility. Current version 1.0.3, stable maintenance mode. Lightweight, focused solely on detecting empty alt text in Markdown images, unlike broader lint rules that may cover other accessibility concerns.","status":"active","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/salesforce/remark-lint-no-empty-image-alt-text","tags":["javascript","remark","lint","rule","remark-lint-rule","accessibility","image"],"install":[{"cmd":"npm install remark-lint-no-empty-image-alt-text","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-no-empty-image-alt-text","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-no-empty-image-alt-text","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"required as plugin framework for lint rules","package":"remark-lint","optional":false},{"reason":"need remark parser to process Markdown","package":"remark","optional":false}],"imports":[{"note":"ESM default import; CJS require also works but TypeScript may need esModuleInterop.","wrong":"const imageAltText = require('remark-lint-no-empty-image-alt-text')","symbol":"default","correct":"import imageAltText from 'remark-lint-no-empty-image-alt-text'"},{"note":"remark-lint is a required peer dependency and should be imported similarly.","wrong":"const remarkLint = require('remark-lint')","symbol":"remarkLint","correct":"import remarkLint from 'remark-lint'"},{"note":"remark package exports a named export 'remark' (function). Default export does not exist in ESM.","wrong":"import remark from 'remark'","symbol":"remark","correct":"import { remark } from 'remark'"}],"quickstart":{"code":"import { remark } from 'remark';\nimport remarkLint from 'remark-lint';\nimport imageAltText from 'remark-lint-no-empty-image-alt-text';\n\nconst file = await remark()\n  .use(remarkLint)\n  .use(imageAltText)\n  .process('![](./media/example.png)');\n\nconsole.log(String(file));","lang":"javascript","description":"Shows how to use the rule with remark to lint an image lacking alt text."},"warnings":[{"fix":"Use additional lint rules to cover HTML img tags if needed.","message":"The rule only checks for empty alt text (e.g., `![](url)`) but does not check for missing alt attribute in HTML `<img>` tags within Markdown.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set esModuleInterop: true in tsconfig.json, or use import syntax with .default.","message":"When using CommonJS require, TypeScript may require esModuleInterop enabled to import default export.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Monitor for newer versions or switch to a more active lint rule like `remark-lint-no-empty-alt-text`.","message":"The package is in maintenance mode with no recent updates. Consider that future remark versions may break compatibility.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install remark-lint-no-empty-image-alt-text","cause":"Missing installation of the package.","error":"Error: Cannot find module 'remark-lint-no-empty-image-alt-text'"},{"fix":"Use `import { remark } from 'remark'` instead of `import remark from 'remark'`.","cause":"Importing remark incorrectly; using default import instead of named export.","error":"TypeError: remark().use is not a function"},{"fix":"Add alt text inside the brackets: `![description](url)`","cause":"Valid lint warning – no fix needed, but alt text should be added.","error":"Warning: Missing alt text for image!  no-empty-image-alt-text  remark-lint"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}