Registry /
testing / remark-lint-mdx-jsx-unique-attribute-name
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.
remarkLintMdxJsxUniqueAttributeName
✓ import remarkLintMdxJsxUniqueAttributeName from 'remark-lint-mdx-jsx-unique-attribute-name'
✗ import { remarkLintMdxJsxUniqueAttributeName } from 'remark-lint-mdx-jsx-unique-attribute-name'
Default export; named import will fail. ESM only.
remarkLintMdxJsxUniqueAttributeName (require)
✓ const remarkLintMdxJsxUniqueAttributeName = require('remark-lint-mdx-jsx-unique-attribute-name')
CommonJS is not supported; this package is ESM-only. Use dynamic import or switch to ESM.
TypeScript usage
✓ import remarkLintMdxJsxUniqueAttributeName from 'remark-lint-mdx-jsx-unique-attribute-name'
Types are bundled, no separate @types package needed.
Shows how to use the rule in a unified pipeline to lint MDX files for duplicate JSX attribute names.
import { unified } from 'unified';
import remarkParse from 'remark-parse';
import remarkStringify from 'remark-stringify';
import remarkLint from 'remark-lint';
import remarkLintMdxJsxUniqueAttributeName from 'remark-lint-mdx-jsx-unique-attribute-name';
import { read } from 'to-vfile';
import { reporter } from 'vfile-reporter';
const file = await read('example.mdx');
await unified()
.use(remarkParse)
.use(remarkLint)
.use(remarkLintMdxJsxUniqueAttributeName)
.use(remarkStringify)
.process(file);
console.error(reporter(file));
Errors
Common errors & fixes
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.
Using named import on a default-export-only package.
fixChange to default import: import remarkLintMdxJsxUniqueAttributeName from 'remark-lint-mdx-jsx-unique-attribute-name'
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.
Using require() on an ESM-only package.
fixUse import or dynamic import: const mod = await import('remark-lint-mdx-jsx-unique-attribute-name') TypeError: remarkLintMdxJsxUniqueAttributeName is not a function
Importing the wrong symbol (e.g., destructured) or misusing the plugin.
fixEnsure you use default import and call .use() with the imported function directly.
Audit
Dependencies
unifiedrequiredPeer dependency; required for plugin integration
remark-lintrequiredPeer dependency; the rule must be used as a remark-lint plugin
remark-mdxoptionalOften required in practice to parse MDX files