chore: squashed 2 commits

This commit is contained in:
Zamiell 2026-02-06 18:15:26 -05:00
parent 63fefcbd4a
commit 62911b97e5
3 changed files with 5146 additions and 1 deletions

View file

@ -19,8 +19,13 @@ npx ajv-cli validate -s ./markdownlint/schema/markdownlint-config-schema.json -d
By default, any rule name is valid because of custom rules. To allow only
built-in rules, use the
[`markdownlint-config-schema-strict.json`][markdownlint-config-schema-strict]
JSON Schema instead.
schema instead.
To allow trailing commas in a JSONC file, use the
[`markdownlint-config-schema-jsonc.json`][markdownlint-config-schema-jsonc]
schema instead. (This is based on the strict schema.)
[json-schema]: https://json-schema.org
[markdownlint-config-schema]: markdownlint-config-schema.json
[markdownlint-config-schema-strict]: markdownlint-config-schema-strict.json
[markdownlint-config-schema-jsonc]: markdownlint-config-schema-jsonc.json

View file

@ -12,6 +12,8 @@ const schemaName = "markdownlint-config-schema.json";
const schemaUri = `https://raw.githubusercontent.com/DavidAnson/markdownlint/v${version}/schema/${schemaName}`;
const schemaStrictName = "markdownlint-config-schema-strict.json";
const schemaStrictUri = `https://raw.githubusercontent.com/DavidAnson/markdownlint/v${version}/schema/${schemaStrictName}`;
const schemaJsoncName = "markdownlint-config-schema-jsonc.json";
const schemaJsoncUri = `https://raw.githubusercontent.com/DavidAnson/markdownlint/v${version}/schema/${schemaJsoncName}`;
// Schema scaffolding
const schema = {
@ -691,6 +693,15 @@ const schemaStrict = {
const schemaFileStrict = path.join(__dirname(import.meta), schemaStrictName);
await fs.writeFile(schemaFileStrict, JSON.stringify(schemaStrict, null, " "));
// Create and write JSONC schema
const schemaJsonc = {
...schemaStrict,
"$id": schemaJsoncUri,
"allowTrailingCommas": true
};
const schemaFileJsonc = path.join(__dirname(import.meta), schemaJsoncName);
await fs.writeFile(schemaFileJsonc, JSON.stringify(schemaJsonc, null, " "));
// Write TypeScript declaration file
const declarationStrictName = path.join(__dirname(import.meta), "..", "lib", "configuration-strict.d.ts");
schemaStrict.title = "ConfigurationStrict";

File diff suppressed because it is too large Load diff