{"id":26237,"library":"remark-lint-mdx-jsx-shorthand-attribute","title":"remark-lint-mdx-jsx-shorthand-attribute","description":"A remark-lint rule that warns when verbose boolean attribute values (like `planet={true}`) are used in MDX JSX, enforcing shorthand syntax (`planet`). Version 1.0.0 stable release, part of the remark-lint ecosystem. ESM-only, requires Node 16+. Differentiators: focused MDX-specific linting, no configuration needed. Alternative to general remark-lint rules without MDX awareness.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","attribute","jsx","lint","mdx","remark","remark-lint","remark-lint-rule","rule","typescript"],"install":[{"cmd":"npm install remark-lint-mdx-jsx-shorthand-attribute","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-mdx-jsx-shorthand-attribute","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-mdx-jsx-shorthand-attribute","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"required as the lint engine for this rule","package":"remark-lint","optional":false}],"imports":[{"note":"ESM-only package; CommonJS require will fail.","wrong":"const remarkLintMdxJsxShorthandAttribute = require('remark-lint-mdx-jsx-shorthand-attribute')","symbol":"remarkLintMdxJsxShorthandAttribute","correct":"import remarkLintMdxJsxShorthandAttribute from 'remark-lint-mdx-jsx-shorthand-attribute'"},{"note":"The package exports only a default export; named imports are incorrect.","wrong":"import { remarkLintMdxJsxShorthandAttribute } from 'remark-lint-mdx-jsx-shorthand-attribute'","symbol":"default export","correct":"import remarkLintMdxJsxShorthandAttribute from 'remark-lint-mdx-jsx-shorthand-attribute'"},{"note":"Types are not exported from this package; use unified's Plugin type instead.","wrong":"import type { remarkLintMdxJsxShorthandAttribute } from 'remark-lint-mdx-jsx-shorthand-attribute'","symbol":"type import","correct":"import type { Plugin } from 'unified'"}],"quickstart":{"code":"import { read } from 'to-vfile';\nimport { reporter } from 'vfile-reporter';\nimport { unified } from 'unified';\nimport remarkParse from 'remark-parse';\nimport remarkStringify from 'remark-stringify';\nimport remarkLint from 'remark-lint';\nimport remarkLintMdxJsxShorthandAttribute from 'remark-lint-mdx-jsx-shorthand-attribute';\n\nconst file = await read('example.mdx');\nconst result = await unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintMdxJsxShorthandAttribute)\n  .use(remarkStringify)\n  .process(file);\n\nconsole.error(reporter(result));","lang":"typescript","description":"Demonstrates how to use the remark-lint rule with unified pipeline to lint an MDX file."},"warnings":[{"fix":"Use import syntax or dynamic import().","message":"Package is ESM-only and cannot be required with CommonJS require().","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Do not use this rule if MDX contains non-JavaScript expressions.","message":"The rule assumes JavaScript; false positives may occur with other languages in MDX.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add the rule to your remark-lint plugin list manually.","message":"This rule is not included in any preset; must be explicitly added.","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":"Run `npm install remark-lint-mdx-jsx-shorthand-attribute`","cause":"Package not installed","error":"Cannot find package 'remark-lint-mdx-jsx-shorthand-attribute'"},{"fix":"Change `<Component prop={true} />` to `<Component prop />`","cause":"Using `prop={true}` instead of `prop` in MDX JSX","error":"Unexpected verbose attribute value, expected shorthand boolean attribute"},{"fix":"Replace require() with import or use dynamic import()","cause":"Using require() on an ESM-only package","error":"ERR_REQUIRE_ESM"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}