{"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,"search_vec":"'-05':16 '-23':17 '1.1.0':13 '2025':15 '3':20 '5':27 'break':50 'browser':54 'depend':30 'differenti':32 'direct':39 'esm':23 'esm-on':22 'file':10 'generic':45 'gfm':41 'javascript':56 'key':31 'latest':11 'lint':8,60 'markdown':46 'mdx':4,9,19,34,51,61 'nativ':33 'pars':35 'peer':29 'plugin':3,6,47,59 'releas':14 'remark':38 'remark-direct':37 'requir':25 'support':18,42 'syntax':52 'textlint':2,5,57 'textlint-plugin-mdx':1 'textlintplugin':58 'typescript':26 'unlik':43 'usag':55 'use':44 'version':12","created_at":"2026-05-01T13:50:08.389365+00:00","updated_at":"2026-05-01T13:50:08.389365+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/textlint/textlint-plugin-mdx","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/textlint-plugin-mdx","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}