-
-
Notifications
You must be signed in to change notification settings - Fork 247
Expand file tree
/
Copy pathembed-schema.cjs
More file actions
16 lines (13 loc) · 674 Bytes
/
embed-schema.cjs
File metadata and controls
16 lines (13 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// @ts-check
"use strict";
const fs = require("node:fs");
const packageJsonPath = "./package.json";
const packageJson = require(packageJsonPath);
const configurationSchema = require("./markdownlint-config-schema.json");
// Update package.json
const configurationRoot = packageJson.contributes.configuration.properties["markdownlint.config"];
configurationRoot.properties = configurationSchema.properties;
configurationRoot.additionalProperties = configurationSchema.additionalProperties;
const text = JSON.stringify(packageJson, null, "\t") + "\n";
const compressed = text.replace(/\s*\r?\n(\t{7,}|\t{6}([}\]]))/gu, " $2");
fs.writeFileSync(packageJsonPath, compressed);