{"id":26468,"library":"textlint-plugin-mdx","title":"textlint-plugin-mdx","description":"textlint plugin to lint MDX files. Latest version 1.1.0 (released 2025-05-23). Supports MDX 3+ with ESM-only, requires TypeScript 5+ as peer dependency. Key differentiator: native MDX parsing with remark-directive and GFM support, unlike using generic markdown plugin which can break MDX syntax. No browser usage.","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/textlint/textlint-plugin-mdx","tags":["javascript","textlint","textlintplugin","plugin","lint","mdx"],"install":[{"cmd":"npm install textlint-plugin-mdx","lang":"bash","label":"npm"},{"cmd":"yarn add textlint-plugin-mdx","lang":"bash","label":"yarn"},{"cmd":"pnpm add textlint-plugin-mdx","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for type resolution","package":"typescript","optional":true}],"imports":[{"note":"ESM-only package; CommonJS require will fail","wrong":"const textlintPluginMdx = require('textlint-plugin-mdx')","symbol":"default","correct":"import textlintPluginMdx from 'textlint-plugin-mdx'"},{"note":"Default export is the plugin object; named export 'plugin' also available","wrong":"import plugin from 'textlint-plugin-mdx'","symbol":"plugin","correct":"import { plugin } from 'textlint-plugin-mdx'"},{"note":"Type-only import recommended for options type","wrong":"import { TextlintPluginOptions } from 'textlint-plugin-mdx'","symbol":"TextlintPluginOptions","correct":"import type { TextlintPluginOptions } from 'textlint-plugin-mdx'"}],"quickstart":{"code":"// .textlintrc.json\n{\n  \"plugins\": {\n    \"mdx\": true\n  }\n}\n\n// Or programmatic usage:\nimport { TextLintEngine } from 'textlint';\n\nconst engine = new TextLintEngine({\n  plugins: [\n    ['textlint-plugin-mdx', {\n      extensions: ['.mdx']\n    }]\n  ],\n  rules: {\n    'no-todo': true\n  }\n});\n\nconst results = await engine.executeOnFiles(['example.mdx']);\nconsole.log(results);","lang":"typescript","description":"Shows how to configure textlint-plugin-mdx in .textlintrc.json and use it programmatically with ESLint-like results."},"warnings":[{"fix":"Use import syntax or dynamic import()","message":"ESM-only package; require() will throw error","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Remove .mdx from @textlint/textlint-plugin-markdown extensions and use textlint-plugin-mdx","message":"Using @textlint/textlint-plugin-markdown with .mdx extension breaks MDX parsing","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Install TypeScript: npm install --save-dev typescript@^5.0.0","message":"Requires TypeScript 5+ as peer dependency even if not using TypeScript, but it's optional","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use plugin directly as object, not with new","message":"Default export is plugin object, not a class; new operator will fail","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install package: npm install textlint-plugin-mdx","cause":"Package not installed or not resolved in ESM context","error":"Cannot find module 'textlint-plugin-mdx'"},{"fix":"Use import syntax or set type: 'module' in package.json","cause":"CommonJS require on ESM-only package","error":"require() of ES Module textlint-plugin-mdx not supported"},{"fix":"Use plugin object directly: engine.addPlugin(textlintPluginMdx)","cause":"Default export is an object, not a class; using new on it","error":"TypeError: textlintPluginMdx is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}