Registry /
testing / remark-lint-mdx-jsx-shorthand-attribute
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.
remarkLintMdxJsxShorthandAttribute
✓ import remarkLintMdxJsxShorthandAttribute from 'remark-lint-mdx-jsx-shorthand-attribute'
✗ const remarkLintMdxJsxShorthandAttribute = require('remark-lint-mdx-jsx-shorthand-attribute')
ESM-only package; CommonJS require will fail.
default export
✓ import remarkLintMdxJsxShorthandAttribute from 'remark-lint-mdx-jsx-shorthand-attribute'
✗ import { remarkLintMdxJsxShorthandAttribute } from 'remark-lint-mdx-jsx-shorthand-attribute'
The package exports only a default export; named imports are incorrect.
type import
✓ import type { Plugin } from 'unified'
✗ import type { remarkLintMdxJsxShorthandAttribute } from 'remark-lint-mdx-jsx-shorthand-attribute'
Types are not exported from this package; use unified's Plugin type instead.
Demonstrates how to use the remark-lint rule with unified pipeline to lint an MDX file.
import { read } from 'to-vfile';
import { reporter } from 'vfile-reporter';
import { unified } from 'unified';
import remarkParse from 'remark-parse';
import remarkStringify from 'remark-stringify';
import remarkLint from 'remark-lint';
import remarkLintMdxJsxShorthandAttribute from 'remark-lint-mdx-jsx-shorthand-attribute';
const file = await read('example.mdx');
const result = await unified()
.use(remarkParse)
.use(remarkLint)
.use(remarkLintMdxJsxShorthandAttribute)
.use(remarkStringify)
.process(file);
console.error(reporter(result));
Errors
Common errors & fixes
Cannot find package 'remark-lint-mdx-jsx-shorthand-attribute'
Package not installed
fixRun `npm install remark-lint-mdx-jsx-shorthand-attribute`
Unexpected verbose attribute value, expected shorthand boolean attribute
Using `prop={true}` instead of `prop` in MDX JSX
fixChange `<Component prop={true} />` to `<Component prop />` ERR_REQUIRE_ESM
Using require() on an ESM-only package
fixReplace require() with import or use dynamic import()
Audit
Dependencies
remark-lintrequiredrequired as the lint engine for this rule