{"id":26206,"library":"remark-lint-directive-shortcut-attribute","title":"remark-lint-directive-shortcut-attribute","description":"A remark-lint rule that warns when verbose attribute names (e.g., class=\"value\", id=\"value\") are used in directives instead of shortcut syntax (e.g., .value, #value). Version 1.0.1 is the current stable release, part of the unified ecosystem. ESM-only, requires Node 16+. It is a complementary rule to other directive linting rules and is not included in any preset. Active development with frequent releases across the remark-lint monorepo.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","attribute","directive","lint","remark","remark-lint","remark-lint-rule","rule","shortcut","typescript"],"install":[{"cmd":"npm install remark-lint-directive-shortcut-attribute","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-directive-shortcut-attribute","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-directive-shortcut-attribute","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core unified engine; version 10+ required","package":"unified","optional":false},{"reason":"Parent lint plugin that provides the lint infrastructure","package":"remark-lint","optional":false},{"reason":"Needed at runtime to parse directives; used in examples but not a direct dependency of the rule itself","package":"remark-directive","optional":true}],"imports":[{"note":"ESM-only since v1; no CommonJS support. Node 16+ required.","wrong":"const remarkLintDirectiveShortcutAttribute = require('remark-lint-directive-shortcut-attribute')","symbol":"remarkLintDirectiveShortcutAttribute","correct":"import remarkLintDirectiveShortcutAttribute from 'remark-lint-directive-shortcut-attribute'"},{"note":"This package exports a single default export, not a named export.","wrong":"import { remarkLintDirectiveShortcutAttribute } from 'remark-lint-directive-shortcut-attribute'","symbol":"default export","correct":"import remarkLintDirectiveShortcutAttribute from 'remark-lint-directive-shortcut-attribute'"},{"note":"No additional TypeScript types are exported; the rule's signature is inferred from the default export.","wrong":"","symbol":"TypeScript types","correct":"import remarkLintDirectiveShortcutAttribute from 'remark-lint-directive-shortcut-attribute'"}],"quickstart":{"code":"import { unified } from 'unified'\nimport remarkParse from 'remark-parse'\nimport remarkStringify from 'remark-stringify'\nimport remarkLint from 'remark-lint'\nimport remarkLintDirectiveShortcutAttribute from 'remark-lint-directive-shortcut-attribute'\nimport { reporter } from 'vfile-reporter'\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintDirectiveShortcutAttribute)\n  .use(remarkStringify)\n  .process(':planet[Jupiter]{class=\"fifth largest\" id=\"jupiter\"}')\n\nconsole.error(reporter(file))\n// Output:\n//   1:18-1:23  warning  Unexpected verbose attribute name `class`, expected shortcut attribute with `.`  directive-shortcut-attribute  remark-lint\n//   1:40-1:42  warning  Unexpected verbose attribute name `id`, expected shortcut attribute with `#`     directive-shortcut-attribute  remark-lint","lang":"typescript","description":"Shows how to set up the rule to warn on verbose attribute names in directive syntax."},"warnings":[{"fix":"Use import syntax or dynamic import(); upgrade to Node 16+.","message":"ESM-only: package cannot be required via require() in Node.js","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"npm install remark-lint unified","message":"Rule requires remark-lint and unified to be installed as peer dependencies; missing them causes runtime errors","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure you have a directive plugin (like remark-directive) added to your unified pipeline before the lint rules.","message":"The rule only works if remark-directive or another directive parser is used; otherwise it may not detect directives","severity":"gotcha","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-directive-shortcut-attribute && ensure package.json has \"type\": \"module\" or use .mjs extension.","cause":"Package not installed or ESM-only in a CommonJS project","error":"Cannot find module 'remark-lint-directive-shortcut-attribute'"},{"fix":"Add the plugin to your remark configuration array: plugins: ['remark-lint', 'remark-lint-directive-shortcut-attribute']","cause":"CLI misconfiguration or missing import when using unified programmatically","error":"Could not load plugin \"remark-lint-directive-shortcut-attribute\" from ..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}