Registry / testing / remark-lint-mdx-jsx-unique-attribute-name

remark-lint-mdx-jsx-unique-attribute-name

JSON →
library1.0.1jsnpmunverified

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.

npm install remark-lint-mdx-jsx-unique-attribute-name
INSTALL
IMPORT
SIG · REMARK-LINT-MDX-JS
R
remark-lint-mdx-jsx-unique-attribute-name
testingjavascriptv1.0.1
harness data pending
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));
Debug
Known issues
breakingPackage is ESM-only since v1. CommonJS require() will throw.
fix
Use ESM imports or dynamic import.
affects: >=1.0.0
gotchaThis rule only checks MDX JSX elements, not HTML or Markdown. Must be used with remark-mdx to parse MDX.
fix
Add remark-mdx to your unified pipeline.
affects: >=1.0.0
gotchaDefault export is a function, not an object. Attempting to destructure will result in undefined.
fix
Use default import: import remarkLintMdxJsxUniqueAttributeName from 'remark-lint-mdx-jsx-unique-attribute-name'
affects: >=1.0.0
deprecatedNo deprecation warnings known for this version.
fix
N/A
affects: >=1.0.0
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.
fix
Change 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.
fix
Use 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.
fix
Ensure you use default import and call .use() with the imported function directly.
Upgrade
Version history
1.0.1latest on npm
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
Agent activity
2 hits · last 30 days
node
2
Resources
remark-lint-mdx-jsx-unique-attribute-name — npm install remark-lint-mdx-jsx-unique-attribute-name · libregistry