AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Configure Grammarly in VS Code to Ignore Markdown Code Blocks, YAML Frontmatter, and Inline Syntax

Yap Si Ling · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

If you write documentation in Visual Studio Code, watching Grammarly treat your YAML metadata and Python snippets like misspelled English is infuriating. Every camelCase variable gets a red squiggly line. Every frontmatter tag triggers an alert.

Here is the direct answer: in the legacy community extension znck.grammarly, you suppress code blocks and inline syntax by adding AST ignore rules to settings.json. But 365Finds must give you the unvarnished commercial reality first: Grammarly officially discontinued its developer SDK in 2024, leaving community VS Code extensions archived, while the system-level Grammarly Desktop app cannot parse Markdown AST at all.

Below is how to configure the ignore syntax if you maintain an existing setup, how to silence Grammarly Desktop's intrusive overlays in VS Code, and what 365Finds recommends technical writing teams actually deploy instead.


1. Configuring AST Node Suppression in settings.json

The primary extension that brought Grammarly directly into VS Code was Rahul Kadyan’s znck.grammarly. It utilized a tree-sitter Markdown parser to separate prose from underlying syntax.

To stop the extension from flagging fenced code blocks and inline backticks, add the grammarly.diagnostics block to your user or workspace settings.json:

{
  "grammarly.diagnostics": {
    "[markdown]": {
      "ignore": [
        "code",
        "inlineCode"
      ]
    }
  },
  "grammarly.files.include": [
    "**/*.md",
    "**/*.markdown"
  ],
  "grammarly.files.exclude": [
    "**/node_modules/**",
    "**/.git/**"
  ]
}

What These Keys Do

The Problem with YAML Frontmatter

The tree-sitter grammar inside znck.grammarly never handled YAML frontmatter cleanly. Frontmatter headers—the block bounded by --- at the top of Jekyll, Hugo, Astro, or Docusaurus files—contain key-value pairs (layout: doc, slug: /api-v1).

Because the parser frequently interprets frontmatter as raw text rather than an ignored structural node, syntax properties like tags: or unquoted titles continue to trigger grammar false positives. You cannot reliably pass "frontmatter" or "yaml" to ignore in unpatched versions of the extension.


2. Dealing with Grammarly Desktop in VS Code

Many technical writers do not run an extension at all; they run the Grammarly Desktop client for macOS or Windows.

Grammarly Desktop injects a floating widget into active text fields across your operating system. In VS Code, it sees an open Markdown document as an enormous plain-text buffer. It has zero awareness of Markdown abstract syntax trees (AST). It flags indented shell commands, underlines YAML keys, and tries to "correct" URL fragments inside Markdown links.

365Finds strongly advises against letting Grammarly Desktop hook into VS Code. The cognitive noise destroys developer flow.

How to Blacklist VS Code in Grammarly Desktop:

  1. Open the Grammarly Desktop application from your system tray or menu bar.
  2. Navigate to Settings (or Preferences).
  3. Select the Blocked Applications tab (or Turn Off Grammarly in...).
  4. Add Visual Studio Code (Code.exe on Windows, Visual Studio Code.app on macOS) to the blocked list.

This silences the floating overlay and stops the client from fighting your code editor.


3. The Structural Breakdown: Why Grammarly Fails Technical Writers

At 365Finds, our assessment is straightforward: Grammarly was engineered for continuous linear prose—emails, corporate memos, academic essays, and Google Docs. It operates on statistical natural language models that expect punctuation, full sentences, and standard capitalization.

Markdown files for technical documentation are not linear prose. They are hybrid documents containing:

When Grammarly’s developer SDK was active, community developers attempted to bridge this gap by parsing the AST and stripping non-prose nodes before sending text to Grammarly’s API. When Grammarly sunset its Text Editor SDK in January 2024 to consolidate resources on its proprietary enterprise apps, that bridge collapsed. The znck/grammarly repository was archived in May 2024.


4. The 365Finds Recommended Setup for VS Code Documentation

If your team is trying to force Grammarly to behave inside VS Code, 365Finds recommends abandoning the workaround. Running archived extensions with broken authentication or enduring a blind desktop widget is a waste of engineering time.

Technical writing teams should implement a two-tier architecture:

┌────────────────────────────────────────────────────────┐
│                   VS Code Workspace                    │
│                                                        │
│   ┌─────────────────────┐    ┌─────────────────────┐   │
│   │        Vale         │    │       LTeX+         │   │
│   │ (Prose Style & AST) │    │ (Grammar/Syntax)    │   │
│   └──────────┬──────────┘    └──────────┬──────────┘   │
└──────────────┼──────────────────────────┼──────────────┘
               ▼                          ▼
       Native AST Ignores:        Native AST Ignores:
       • Fenced Code Blocks       • YAML Frontmatter
       • Inline Backticks         • Code Blocks
       • Frontmatter Keys         • Raw HTML/MDX

Option A: Vale (The Gold Standard for Docs Teams)

Vale is an open-source prose linter built from the ground up for technical writers. It parses Markdown AST natively.

Option B: LTeX+ (For Real-Time Offline Grammar Checking)

If you want real-time grammar checking that feels like Grammarly without the syntax interference, install LTeX+ (the maintained community fork of vscode-ltex using LanguageTool).

When Grammarly Still Has a Role

If your organization requires Grammarly Premium for final executive review, do not run it inside VS Code. Write and lint your Markdown files in VS Code using Vale or LTeX+. Once the document reaches the review or staging phase, copy the rendered HTML preview or text output into Grammarly Web for a final polish.


References