Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-mdx

Package Overview
Dependencies
Maintainers
4
Versions
109
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.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
271K
decreased by-11.04%
Maintainers
4
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

FAQs

Package last updated on 14 Jan 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc