Add $id to configuration schema, switch to version-specific repository links.

This commit is contained in:
David Anson 2023-11-24 15:23:36 -08:00
parent 24ee072442
commit 316b0989c3
6 changed files with 36 additions and 33 deletions

View file

@ -7,13 +7,22 @@ const path = require("node:path");
/** @type {import("../lib/markdownlint").Rule[]} */
const rules = require("../lib/rules");
const jsonSchemaToTypeScript = require("json-schema-to-typescript");
const { version } = require("../lib/constants");
const schemaUri = `https://raw.githubusercontent.com/DavidAnson/markdownlint/v${version}/schema/markdownlint-config-schema.json`;
// Schema scaffolding
const schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": schemaUri,
"title": "markdownlint configuration schema",
"type": "object",
"properties": {
"$schema": {
"description": "JSON Schema URI (expected by some editors)",
"type": "string",
"default": schemaUri
},
"default": {
"description": "Default state for all rules",
"type": "boolean",
@ -26,12 +35,6 @@ const schema = {
"null"
],
"default": null
},
"$schema": {
"description": "JSON Schema URI (used by some editors)",
"type": "string",
"default": "https://raw.githubusercontent.com/DavidAnson/markdownlint" +
"/main/schema/markdownlint-config-schema.json"
}
},
"additionalProperties": {

View file

@ -1,8 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.32.1/schema/markdownlint-config-schema.json",
"title": "markdownlint configuration schema",
"type": "object",
"properties": {
"$schema": {
"description": "JSON Schema URI (expected by some editors)",
"type": "string",
"default": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.32.1/schema/markdownlint-config-schema.json"
},
"default": {
"description": "Default state for all rules",
"type": "boolean",
@ -16,11 +22,6 @@
],
"default": null
},
"$schema": {
"description": "JSON Schema URI (used by some editors)",
"type": "string",
"default": "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json"
},
"MD001": {
"description": "MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md001.md",
"type": "boolean",