mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-03-14 22:16:30 +01:00
chore: squashed 2 commits
This commit is contained in:
parent
63fefcbd4a
commit
62911b97e5
3 changed files with 5146 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
5129
schema/markdownlint-config-schema-jsonc.json
Normal file
5129
schema/markdownlint-config-schema-jsonc.json
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue