{"id":26234,"library":"remark-lint-mdx-jsx-quote-style","title":"remark-lint-mdx-jsx-quote-style","description":"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.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","attribute","jsx","lint","mdx","quote","remark","remark-lint","remark-lint-rule","typescript"],"install":[{"cmd":"npm install remark-lint-mdx-jsx-quote-style","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-mdx-jsx-quote-style","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-mdx-jsx-quote-style","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This is a remark-lint rule; it must be used with the remark-lint plugin","package":"remark-lint","optional":false},{"reason":"The unified ecosystem is required to process Markdown/MDX","package":"unified","optional":false}],"imports":[{"note":"ESM-only since v1; default export, not named. The package exports no named identifiers.","wrong":"const { remarkLintMdxJsxQuoteStyle } = require('remark-lint-mdx-jsx-quote-style')","symbol":"remarkLintMdxJsxQuoteStyle","correct":"import remarkLintMdxJsxQuoteStyle from 'remark-lint-mdx-jsx-quote-style'"},{"note":"Options is a TypeScript type only; use import type to avoid runtime import errors.","wrong":"import { Options } from 'remark-lint-mdx-jsx-quote-style'","symbol":"Options","correct":"import type { Options } from 'remark-lint-mdx-jsx-quote-style'"},{"note":"Style is a TypeScript type; use import type or inline the union type '\"' | \"'\".","wrong":"const Style = require('remark-lint-mdx-jsx-quote-style').Style","symbol":"Style","correct":"import type { Style } from 'remark-lint-mdx-jsx-quote-style'"}],"quickstart":{"code":"import { unified } from 'unified';\nimport remarkParse from 'remark-parse';\nimport remarkStringify from 'remark-stringify';\nimport remarkLint from 'remark-lint';\nimport remarkLintMdxJsxQuoteStyle from 'remark-lint-mdx-jsx-quote-style';\nimport { read } from 'to-vfile';\nimport { reporter } from 'vfile-reporter';\n\nconst file = await read('example.mdx');\n\nawait unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintMdxJsxQuoteStyle, '\"') // enforce double quotes\n  .use(remarkStringify)\n  .process(file);\n\nconsole.error(reporter(file));","lang":"typescript","description":"Shows how to use the rule with unified, enforcing double quotes and reporting lint messages."},"warnings":[{"fix":"Use import or switch to a dynamic import() if using CommonJS.","message":"The package is ESM-only; it cannot be required with CommonJS.","severity":"breaking","affected_versions":">=1.0"},{"fix":"Upgrade Node.js to 16+ or use an older version of the package.","message":"Node.js version must be 16 or higher.","severity":"breaking","affected_versions":">=1.0"},{"fix":"Always use with .use() in a unified pipeline.","message":"The default export is a function that expects a unified plugin context; using it incorrectly as a middleware can cause runtime errors.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Specify an explicit style like '\"' or \"'\" to avoid detection uncertainty.","message":"The 'consistent' option (default) will detect the first quote style and enforce it, which may conflict with formatters that use a different style.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"N/A","message":"No deprecation warnings; the package is actively maintained.","severity":"deprecated","affected_versions":"none"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Change to import: import remarkLintMdxJsxQuoteStyle from 'remark-lint-mdx-jsx-quote-style'","cause":"Using require() on an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/remark-lint-mdx-jsx-quote-style from /path/to/project not supported."},{"fix":"Ensure the import is correct: import remarkLintMdxJsxQuoteStyle from 'remark-lint-mdx-jsx-quote-style' and then use it with .use(remarkLintMdxJsxQuoteStyle)","cause":"The package's default export may not be invoked correctly; usually due to incorrect import syntax.","error":"TypeError: remarkLintMdxJsxQuoteStyle is not a function"},{"fix":"Ensure the unified pipeline includes .use(remarkParse) and .use(remarkLint) before this rule.","cause":"The rule is used outside a unified pipeline or without remark-parse.","error":"TypeError: Cannot read properties of undefined (reading 'type')"},{"fix":"Upgrade Node.js to 16+ or use a transpiler like esbuild.","cause":"Node.js version is too old (<16) to support ESM syntax.","error":"SyntaxError: Unexpected token 'export' at ...remark-lint-mdx-jsx-quote-style/src/index.js:1"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}