Skip to content

VS Code ESLint extension shows no diagnostics for .md when MDC is enabled (flat config + @eslint/markdown); CLI works #72

@CyberT33N

Description

@CyberT33N

Description

When the VS Code MDC extension is enabled, the VS Code ESLint extension does not show any diagnostics for Markdown files that are linted via ESLint v9 flat config with @eslint/markdown. Running ESLint via CLI reports the expected findings. Disabling MDC or switching the editor language mode back to “Markdown” restores diagnostics in the editor.

This looks like an integration conflict between the MDC extension and the VS Code ESLint extension for .md files.

Why I think this is MDC-related

  • With MDC installed and active, .md buffers in VS Code show no ESLint diagnostics.
  • Removing the MDC extension (or changing the language mode to “Markdown” in the status bar) makes diagnostics appear immediately.
  • ESLint via CLI continues to report diagnostics regardless of MDC being installed, so the ESLint configuration itself is valid.

Given MDC’s features (syntax highlighting, formatting, document folding, component completions for MDC/Markdown), it may be changing the language id or otherwise taking ownership of .md buffers in a way that prevents the ESLint extension from validating the document.

Reference: the MDC extension provides syntax highlighting, folding, formatting, and suggestions for MDC/Markdown files as described in its README link.

Environment

  • ESLint: 9.36.0
  • @eslint/markdown: 7.4.0
  • VS Code ESLint server runtime: Node 22.9 (from ESLint extension debug output)
  • Node (CLI): 22.14.0
  • OS: Linux 6.8.0-83-generic
  • VS Code MDC: v0.4.2
  • VS Code ESLint extension: latest at time of testing
  • VS Code: latest stable at time of testing

Minimal Reproduction

  1. Flat config enabling Markdown language rules (excerpt):
// eslint.config.ts
import eslintPluginMarkdown from '@eslint/markdown';

export default [
  {
    files: ['**/*.md', '**/*.mdx'],
    language: 'markdown/gfm',
    plugins: { markdown: eslintPluginMarkdown },
    rules: {
      // e.g. 'markdown/no-html': 'error'
    }
  }
];
  1. Install and enable both extensions:
  • VS Code ESLint
  • VS Code MDC
  1. Open a .md file that violates markdown/* rules.
  • In VS Code: No ESLint diagnostics appear with MDC enabled.
  • In CLI: pnpm eslint README.md shows the expected diagnostics.
  1. Workaround checks:
  • Disable MDC → diagnostics appear in VS Code.
  • Change the editor language mode (status bar) to “Markdown” → diagnostics appear.
  • Optional: Add "eslint.validate": ["mdc", "markdown", "mdx", "javascript", "typescript"] to VS Code settings sometimes restores diagnostics, which suggests the document’s language id may be set to mdc when the extension is enabled.

Minimal public repo (used to validate behavior): https://github.com/CyberT33N/markdown-test

Expected behavior

  • With MDC enabled, the VS Code ESLint extension should still validate .md documents and surface markdown/* diagnostics in the editor, matching the CLI output.

Actual behavior

  • With MDC enabled, .md documents receive no ESLint diagnostics in the editor.
  • Disabling MDC or switching the language mode back to “Markdown” restores diagnostics.

Hypothesis / Possible cause

  • The MDC extension may set the language id of .md documents to a custom id (e.g., mdc), or otherwise register a grammar/formatter that prevents the ESLint extension from probing/validating markdown buffers.
  • If the language id is changed, ESLint’s VS Code extension default probing for markdown won’t trigger unless users explicitly add mdc to eslint.validate.

Workarounds tried

  • Adding mdc to ESLint validation in VS Code settings:
{
  "eslint.validate": ["mdc", "markdown", "mdx", "javascript", "typescript"]
}

This can restore editor diagnostics but requires users to know about the mdc language id and adjust their workspace/user settings.

Questions for maintainers

  • Does the MDC extension intentionally set a custom language id for .md files?
  • Would you consider:
    • Not overriding the language id for .md (using grammar injection into markdown instead), or
    • Limiting the custom language id to .mdc files only, or
    • Providing a setting to opt out of changing .md language id, or
    • Documenting that users must add "mdc" to eslint.validate so ESLint can validate those buffers?
  • Is there another recommended integration path with the ESLint extension so both can work together seamlessly for .md?

Thanks a lot for the great extension and for taking a look!

Related:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions