Registry / testing / remark-lint-mdx-jsx-shorthand-attribute

remark-lint-mdx-jsx-shorthand-attribute

JSON →
library1.0.1jsnpmunverified

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.

npm install remark-lint-mdx-jsx-shorthand-attribute
INSTALL
IMPORT
SIG · REMARK-LINT-MDX-JS
R
remark-lint-mdx-jsx-shorthand-attribute
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.

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));
Debug
Known issues
breakingPackage is ESM-only and cannot be required with CommonJS require().
fix
Use import syntax or dynamic import().
affects: >=1.0.0
gotchaThe rule assumes JavaScript; false positives may occur with other languages in MDX.
fix
Do not use this rule if MDX contains non-JavaScript expressions.
affects: >=1.0.0
gotchaThis rule is not included in any preset; must be explicitly added.
fix
Add the rule to your remark-lint plugin list manually.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find package 'remark-lint-mdx-jsx-shorthand-attribute'
Package not installed
fix
Run `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
fix
Change `<Component prop={true} />` to `<Component prop />`
ERR_REQUIRE_ESM
Using require() on an ESM-only package
fix
Replace require() with import or use dynamic import()
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
remark-lintrequiredrequired as the lint engine for this rule
Agent activity
2 hits · last 30 days
node
2
Resources
remark-lint-mdx-jsx-shorthand-attribute — npm install remark-lint-mdx-jsx-shorthand-attribute · libregistry