{"library":"markdown-eslint-parser","title":"ESLint Custom Parser for Markdown Files","description":"markdown-eslint-parser is a custom ESLint parser designed to enable linting of `.md` (Markdown) files, primarily in conjunction with `eslint-plugin-md`. Unlike standard parsers that generate a full AST for the parsed language, this package uniquely returns an empty JavaScript AST with a special `mdCode` property containing the raw Markdown content as a string. This allows `eslint-plugin-md` to process the Markdown itself using tools like `remark-lint`. The current stable version is 1.2.1. Given the recent introduction and active development of the official `@eslint/markdown` (which offers integrated parsing and rules for CommonMark and GitHub-Flavored Markdown) and the last update of its primary companion `eslint-plugin-md` dating back about two years, `markdown-eslint-parser` should be considered superseded for new projects. It maintains a niche for existing setups reliant on `eslint-plugin-md`.","language":"javascript","status":"deprecated","last_verified":"Sun Apr 19","install":{"commands":["npm install markdown-eslint-parser"],"cli":null},"imports":["module.exports = {\n  overrides: [\n    {\n      files: ['*.md'],\n      parser: 'markdown-eslint-parser',\n    },\n  ],\n};"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"yarn add -D eslint markdown-eslint-parser eslint-plugin-md\n\n// .eslintrc.js (for legacy ESLint configurations)\nmodule.exports = {\n  extends: [\n    // ... other configs (e.g., 'eslint:recommended', 'plugin:md/recommended')\n  ],\n  overrides: [\n    {\n      files: ['*.md'],\n      // This parser extracts Markdown content for 'eslint-plugin-md'.\n      // It doesn't produce a JS AST for the Markdown itself.\n      parser: 'markdown-eslint-parser',\n      rules: {\n        // Example: If using eslint-plugin-md, configure its rules here\n        // 'md/remark': 'error',\n      },\n    },\n    {\n      // This block targets JavaScript code blocks *within* Markdown files\n      // for standard JavaScript linting. Requires eslint-plugin-markdown.\n      files: ['**/*.md/*.js'],\n      rules: {\n        'no-console': 'off', // Example: Relax rules for code snippets\n      },\n    },\n  ],\n};\n\n// To run ESLint from CLI (for legacy config):\n// eslint . --ext js,md","lang":"javascript","description":"Demonstrates how to configure `markdown-eslint-parser` in a legacy `.eslintrc.js` file for linting `.md` files alongside `eslint-plugin-md`, and how to lint JavaScript code blocks within Markdown.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}