Registry /
testing / remark-lint-directive-shortcut-attribute
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
remarkLintDirectiveShortcutAttribute
✓ import remarkLintDirectiveShortcutAttribute from 'remark-lint-directive-shortcut-attribute'
✗ const remarkLintDirectiveShortcutAttribute = require('remark-lint-directive-shortcut-attribute')
ESM-only since v1; no CommonJS support. Node 16+ required.
default export
✓ import remarkLintDirectiveShortcutAttribute from 'remark-lint-directive-shortcut-attribute'
✗ import { remarkLintDirectiveShortcutAttribute } from 'remark-lint-directive-shortcut-attribute'
This package exports a single default export, not a named export.
TypeScript types
✓ import remarkLintDirectiveShortcutAttribute from 'remark-lint-directive-shortcut-attribute'
No additional TypeScript types are exported; the rule's signature is inferred from the default export.
Shows how to set up the rule to warn on verbose attribute names in directive syntax.
import { unified } from 'unified'
import remarkParse from 'remark-parse'
import remarkStringify from 'remark-stringify'
import remarkLint from 'remark-lint'
import remarkLintDirectiveShortcutAttribute from 'remark-lint-directive-shortcut-attribute'
import { reporter } from 'vfile-reporter'
const file = await unified()
.use(remarkParse)
.use(remarkLint)
.use(remarkLintDirectiveShortcutAttribute)
.use(remarkStringify)
.process(':planet[Jupiter]{class="fifth largest" id="jupiter"}')
console.error(reporter(file))
// Output:
// 1:18-1:23 warning Unexpected verbose attribute name `class`, expected shortcut attribute with `.` directive-shortcut-attribute remark-lint
// 1:40-1:42 warning Unexpected verbose attribute name `id`, expected shortcut attribute with `#` directive-shortcut-attribute remark-lint
Errors
Common errors & fixes
Cannot find module 'remark-lint-directive-shortcut-attribute'
Package not installed or ESM-only in a CommonJS project
fixnpm install remark-lint-directive-shortcut-attribute && ensure package.json has "type": "module" or use .mjs extension.
Could not load plugin "remark-lint-directive-shortcut-attribute" from ...
CLI misconfiguration or missing import when using unified programmatically
fixAdd the plugin to your remark configuration array: plugins: ['remark-lint', 'remark-lint-directive-shortcut-attribute']
Audit
Dependencies
unifiedrequiredCore unified engine; version 10+ required
remark-lintrequiredParent lint plugin that provides the lint infrastructure
remark-directiveoptionalNeeded at runtime to parse directives; used in examples but not a direct dependency of the rule itself