New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-mdx

Package Overview
Dependencies
Maintainers
0
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-mdx

ESLint Parser for MDX

3.2.0
latest
Source
npm
Version published
Weekly downloads
227K
-13.26%
Maintainers
0
Weekly downloads
 
Created

What is eslint-mdx?

The eslint-mdx package is an ESLint plugin that provides linting support for MDX (Markdown with JSX) files. It helps ensure code quality and consistency in MDX files by leveraging ESLint's capabilities.

What are eslint-mdx's main functionalities?

Linting MDX Files

This configuration allows ESLint to lint MDX files by extending the recommended settings provided by the eslint-mdx plugin.

module.exports = {
  "overrides": [
    {
      "files": ["*.mdx"],
      "extends": ["plugin:mdx/recommended"]
    }
  ]
};

Custom MDX Rules

This configuration demonstrates how to add custom rules for MDX files. In this example, the rule 'mdx/no-jsx-html-comments' is set to 'error' to disallow HTML comments within JSX.

module.exports = {
  "overrides": [
    {
      "files": ["*.mdx"],
      "extends": ["plugin:mdx/recommended"],
      "rules": {
        "mdx/no-jsx-html-comments": "error"
      }
    }
  ]
};

Integrating with Prettier

This configuration shows how to integrate Prettier with eslint-mdx to ensure consistent formatting in MDX files. The 'prettier/prettier' rule is configured to use the 'mdx' parser.

module.exports = {
  "overrides": [
    {
      "files": ["*.mdx"],
      "extends": ["plugin:mdx/recommended", "prettier"],
      "rules": {
        "prettier/prettier": ["error", { "parser": "mdx" }]
      }
    }
  ]
};

Other packages similar to eslint-mdx

Keywords

eslint

FAQs

Package last updated on 08 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts