remark-lint rule to lint and enforce alphabetical ordering of attributes on Markdown directives (e.g., :planet[Saturn]{attr1="val1" attr2="val2"). Stable version 1.0.1 is ESM-only for Node.js 16+. Part of the remark-lint ecosystem, it checks attribute order but does not differentiate attribute values or collapsed syntax. It requires remark-directive to parse directives. Unlike generic linters, it integrates seamlessly into remark pipelines via unified. Released as part of the remark-lint monorepo with TypeScript types included.
npm install remark-lint-directive-attribute-sortNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configure unified pipeline with remark-parse, remark-directive, remark-lint, and the rule; lint example.md and report errors to stderr.
Add .use(remarkDirective) before .use(remarkLintDirectiveAttributeSort)
Upgrade to Node.js 16+ or use dynamic import().
Remove any options; the rule only checks alphabetical order as-is.
Use import instead: import remarkLintDirectiveAttributeSort from 'remark-lint-directive-attribute-sort'
Run npm install remark-lint-directive-attribute-sort (and its peer deps remark-lint, remark-directive, unified, etc.)
Change import { remarkLintDirectiveAttributeSort } to import remarkLintDirectiveAttributeSort