[GH-ISSUE #227] Add $schema to schema #2042

Closed
opened 2026-03-07 20:03:59 +03:00 by kerem · 5 comments
Owner

Originally created by @moltar on GitHub (Oct 12, 2019).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/227

Adding the "$schema" prop would allow IDE support for IntelliSense.

One can add it to the config file themselves, but then IDE throws a little warning that "Property $schema is not allowed." Not a big deal, but it'd be nice to do away without the warning.

{
  "$schema": "./node_modules/markdownlint/schema/markdownlint-config-schema.json",
  "default": true,
  "MD013": {
    "line_length": 100
  }
}
Originally created by @moltar on GitHub (Oct 12, 2019). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/227 Adding the "$schema" prop would allow IDE support for IntelliSense. One can add it to the config file themselves, but then IDE throws a little warning that "Property $schema is not allowed." Not a big deal, but it'd be nice to do away without the warning. ```json { "$schema": "./node_modules/markdownlint/schema/markdownlint-config-schema.json", "default": true, "MD013": { "line_length": 100 } } ```
kerem 2026-03-07 20:03:59 +03:00
Author
Owner

@moltar commented on GitHub (Oct 12, 2019):

image
<!-- gh-comment-id:541355116 --> @moltar commented on GitHub (Oct 12, 2019): <img width="433" alt="image" src="https://user-images.githubusercontent.com/491247/66706803-bd6a7200-ed05-11e9-807c-109d9eeb5370.png">
Author
Owner

@DavidAnson commented on GitHub (Oct 12, 2019):

VS Code with the markdownlint extension installed should already offer schema-based hints and completion without any changes required. What editor are you using above? And what would be necessary to prevent it from complaining about the $schema property?

<!-- gh-comment-id:541356667 --> @DavidAnson commented on GitHub (Oct 12, 2019): VS Code with the `markdownlint` extension installed should already offer schema-based hints and completion without any changes required. What editor are you using above? And what would be necessary to prevent it from complaining about the `$schema` property?
Author
Owner

@DavidAnson commented on GitHub (Oct 12, 2019):

What I’m finding on the web suggests that the $schema keyword only belongs in the schema itself, and not in the data - which is what .markdownlint.json represents in your example above.

https://json-schema.org/understanding-json-schema/basics.html

If you could please include a link to some documentation explaining the scenario you show, that would be greatly appreciated!

<!-- gh-comment-id:541365407 --> @DavidAnson commented on GitHub (Oct 12, 2019): What I’m finding on the web suggests that the `$schema` keyword only belongs in the schema itself, and not in the data - which is what `.markdownlint.json` represents in your example above. https://json-schema.org/understanding-json-schema/basics.html If you could please include a link to some documentation explaining the scenario you show, that would be greatly appreciated!
Author
Owner

@moltar commented on GitHub (Oct 14, 2019):

Maybe it's just VS Code specific, but it is documented here, and I can confirm it works.

https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings

Even without the markdownlint VS Code extension, I get IntelliSense.

Here's a video demo of that: https://drive.google.com/file/d/14TvQkNnwSFo80upePXA-oUudln-qIWMP/view?usp=drivesdk

I renamed $schema to _$schema first to disable the behavior, which then produces meaningless IntelliSense suggestions. After I renamed it back, the IS came back.

<!-- gh-comment-id:541712911 --> @moltar commented on GitHub (Oct 14, 2019): Maybe it's just VS Code specific, but it is documented here, and I can confirm it works. https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings Even without the `markdownlint` VS Code extension, I get IntelliSense. Here's a video demo of that: https://drive.google.com/file/d/14TvQkNnwSFo80upePXA-oUudln-qIWMP/view?usp=drivesdk I renamed `$schema` to `_$schema` first to disable the behavior, which then produces meaningless IntelliSense suggestions. After I renamed it back, the IS came back.
Author
Owner

@DavidAnson commented on GitHub (Oct 14, 2019):

Thanks. This should be fine to add.

<!-- gh-comment-id:541756633 --> @DavidAnson commented on GitHub (Oct 14, 2019): Thanks. This should be fine to add.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#2042
No description provided.