Registry / testing / remark-lint-mdx-jsx-quote-style

remark-lint-mdx-jsx-quote-style

JSON →
library1.0.1jsnpmunverified

A remark-lint rule that warns when MDX JSX attribute value markers violate a configured style (single or double quotes). Current stable version is 1.0.1, released as part of the remark-lint monorepo. It is ESM-only, requires Node.js 16+, and is designed for use with the unified ecosystem. Key differentiators: it supports a 'consistent' mode to detect and enforce the first style used, and integrates with remark-mdx for auto-fixing. Unlike generic quote linters, it specifically targets MDX JSX attributes.

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

remarkLintMdxJsxQuoteStyle
import remarkLintMdxJsxQuoteStyle from 'remark-lint-mdx-jsx-quote-style'
const { remarkLintMdxJsxQuoteStyle } = require('remark-lint-mdx-jsx-quote-style')
ESM-only since v1; default export, not named. The package exports no named identifiers.
Options
import type { Options } from 'remark-lint-mdx-jsx-quote-style'
import { Options } from 'remark-lint-mdx-jsx-quote-style'
Options is a TypeScript type only; use import type to avoid runtime import errors.
Style
import type { Style } from 'remark-lint-mdx-jsx-quote-style'
const Style = require('remark-lint-mdx-jsx-quote-style').Style
Style is a TypeScript type; use import type or inline the union type '"' | "'".

Shows how to use the rule with unified, enforcing double quotes and reporting lint messages.

import { unified } from 'unified'; import remarkParse from 'remark-parse'; import remarkStringify from 'remark-stringify'; import remarkLint from 'remark-lint'; import remarkLintMdxJsxQuoteStyle from 'remark-lint-mdx-jsx-quote-style'; import { read } from 'to-vfile'; import { reporter } from 'vfile-reporter'; const file = await read('example.mdx'); await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintMdxJsxQuoteStyle, '"') // enforce double quotes .use(remarkStringify) .process(file); console.error(reporter(file));
Debug
Known issues
breakingThe package is ESM-only; it cannot be required with CommonJS.
fix
Use import or switch to a dynamic import() if using CommonJS.
affects: >=1.0
breakingNode.js version must be 16 or higher.
fix
Upgrade Node.js to 16+ or use an older version of the package.
affects: >=1.0
gotchaThe default export is a function that expects a unified plugin context; using it incorrectly as a middleware can cause runtime errors.
fix
Always use with .use() in a unified pipeline.
affects: >=1.0
gotchaThe 'consistent' option (default) will detect the first quote style and enforce it, which may conflict with formatters that use a different style.
fix
Specify an explicit style like '"' or "'" to avoid detection uncertainty.
affects: >=1.0
deprecatedNo deprecation warnings; the package is actively maintained.
fix
N/A
affects: none
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/remark-lint-mdx-jsx-quote-style from /path/to/project not supported.
Using require() on an ESM-only package.
fix
Change to import: import remarkLintMdxJsxQuoteStyle from 'remark-lint-mdx-jsx-quote-style'
TypeError: remarkLintMdxJsxQuoteStyle is not a function
The package's default export may not be invoked correctly; usually due to incorrect import syntax.
fix
Ensure the import is correct: import remarkLintMdxJsxQuoteStyle from 'remark-lint-mdx-jsx-quote-style' and then use it with .use(remarkLintMdxJsxQuoteStyle)
TypeError: Cannot read properties of undefined (reading 'type')
The rule is used outside a unified pipeline or without remark-parse.
fix
Ensure the unified pipeline includes .use(remarkParse) and .use(remarkLint) before this rule.
SyntaxError: Unexpected token 'export' at ...remark-lint-mdx-jsx-quote-style/src/index.js:1
Node.js version is too old (<16) to support ESM syntax.
fix
Upgrade Node.js to 16+ or use a transpiler like esbuild.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
remark-lintrequiredThis is a remark-lint rule; it must be used with the remark-lint plugin
unifiedrequiredThe unified ecosystem is required to process Markdown/MDX
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-mdx-jsx-quote-style — npm install remark-lint-mdx-jsx-quote-style · libregistry