ESLint parser and plugin for linting MDX files, including JavaScript/TypeScript code and markdown syntax.
eslint-mdx is an ESLint parser and plugin designed specifically for MDX files. It enables developers to apply ESLint rules to JavaScript and TypeScript code embedded within MDX, and can also lint markdown syntax through integration with remark-lint plugins. This helps maintain code quality and consistency in projects that use MDX for documentation, blogs, or component-driven content.
Developers working with MDX files, such as those building documentation sites, blogs, or component libraries that mix markdown with React components. It's particularly useful for teams enforcing coding standards in MDX-based projects.
Developers choose eslint-mdx because it seamlessly extends ESLint's powerful linting capabilities to MDX files, supports both classic and flat config formats, and integrates with existing remark-lint ecosystems. Its ability to lint both code blocks and markdown syntax in one tool simplifies the development workflow.
ESLint Parser/Plugin for MDX
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Parses MDX files to apply ESLint rules to embedded JavaScript and TypeScript code, enabling full linting of ES syntaxes as described in the README.
Seamlessly integrates with remark-lint plugins to lint markdown syntax, automatically reading remark configuration for consistent content quality.
Supports both classic ESLint config and the newer flat config format, ensuring flexibility and future-proofing for evolving ESLint setups.
Includes VSCode extension integration for real-time syntax highlighting and error reporting in MDX files, enhancing developer workflow.
The README explicitly warns about using ESLint overrides for multi-language setups, adding configuration overhead and potential for errors in complex projects.
Disabling rules with prettier can fail due to prettier adding blank lines, forcing developers to use less convenient disable/enable comment pairs as a workaround.
Options like ignoreRemarkConfig must be specified twice in flat config mode—in parser options and processor settings—as admitted in the usage examples, increasing verbosity.