{"id":26238,"library":"remark-lint-mdx-jsx-unique-attribute-name","title":"remark-lint-mdx-jsx-unique-attribute-name","description":"A remark-lint rule that warns when MDX JSX element attributes have duplicate names. Current stable version is 1.0.1. It is part of the remark-lint ecosystem and ships TypeScript types. Unlike general linting rules, this one is specifically designed for MDX syntax and focuses on JSX-style attribute uniqueness within a single element, helping prevent accidental duplication when writing complex MDX components.","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","name","remark","remark-lint","remark-lint-rule","typescript"],"install":[{"cmd":"npm install remark-lint-mdx-jsx-unique-attribute-name","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-mdx-jsx-unique-attribute-name","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-mdx-jsx-unique-attribute-name","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; required for plugin integration","package":"unified","optional":false},{"reason":"Peer dependency; the rule must be used as a remark-lint plugin","package":"remark-lint","optional":false},{"reason":"Often required in practice to parse MDX files","package":"remark-mdx","optional":true}],"imports":[{"note":"Default export; named import will fail. ESM only.","wrong":"import { remarkLintMdxJsxUniqueAttributeName } from 'remark-lint-mdx-jsx-unique-attribute-name'","symbol":"remarkLintMdxJsxUniqueAttributeName","correct":"import remarkLintMdxJsxUniqueAttributeName from 'remark-lint-mdx-jsx-unique-attribute-name'"},{"note":"CommonJS is not supported; this package is ESM-only. Use dynamic import or switch to ESM.","symbol":"remarkLintMdxJsxUniqueAttributeName (require)","correct":"const remarkLintMdxJsxUniqueAttributeName = require('remark-lint-mdx-jsx-unique-attribute-name')"},{"note":"Types are bundled, no separate @types package needed.","symbol":"TypeScript usage","correct":"import remarkLintMdxJsxUniqueAttributeName from 'remark-lint-mdx-jsx-unique-attribute-name'"}],"quickstart":{"code":"import { unified } from 'unified';\nimport remarkParse from 'remark-parse';\nimport remarkStringify from 'remark-stringify';\nimport remarkLint from 'remark-lint';\nimport remarkLintMdxJsxUniqueAttributeName from 'remark-lint-mdx-jsx-unique-attribute-name';\nimport { read } from 'to-vfile';\nimport { reporter } from 'vfile-reporter';\n\nconst file = await read('example.mdx');\n\nawait unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintMdxJsxUniqueAttributeName)\n  .use(remarkStringify)\n  .process(file);\n\nconsole.error(reporter(file));","lang":"javascript","description":"Shows how to use the rule in a unified pipeline to lint MDX files for duplicate JSX attribute names."},"warnings":[{"fix":"Use ESM imports or dynamic import.","message":"Package is ESM-only since v1. CommonJS require() will throw.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Add remark-mdx to your unified pipeline.","message":"This rule only checks MDX JSX elements, not HTML or Markdown. Must be used with remark-mdx to parse MDX.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use default import: import remarkLintMdxJsxUniqueAttributeName from 'remark-lint-mdx-jsx-unique-attribute-name'","message":"Default export is a function, not an object. Attempting to destructure will result in undefined.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"N/A","message":"No deprecation warnings known for this version.","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":"Change to default import: import remarkLintMdxJsxUniqueAttributeName from 'remark-lint-mdx-jsx-unique-attribute-name'","cause":"Using named import on a default-export-only package.","error":"SyntaxError: Named export 'remarkLintMdxJsxUniqueAttributeName' not found. The requested module 'remark-lint-mdx-jsx-unique-attribute-name' is a CommonJS module, which may not support all module.exports as named exports."},{"fix":"Use import or dynamic import: const mod = await import('remark-lint-mdx-jsx-unique-attribute-name')","cause":"Using require() on an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/remark-lint-mdx-jsx-unique-attribute-name/index.js from /path/to/your-file.js not supported. Instead, rename ... to end with .cjs, change package.json to use type: commonjs, or use dynamic import."},{"fix":"Ensure you use default import and call .use() with the imported function directly.","cause":"Importing the wrong symbol (e.g., destructured) or misusing the plugin.","error":"TypeError: remarkLintMdxJsxUniqueAttributeName is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}