Skip to content

Commit

Permalink
Add $id to configuration schema, switch to version-specific repositor…
Browse files Browse the repository at this point in the history
…y links.
  • Loading branch information
DavidAnson committed Nov 24, 2023
1 parent 8524909 commit 04c26d8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 23 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,12 +455,12 @@ See [CHANGELOG.md][changelog].
[markdown-it-plugins]: https://www.npmjs.com/search?q=keywords:markdown-it-plugin
[markdown-it-syntax-extensions]: https://github.com/markdown-it/markdown-it#syntax-extensions
[markdownlint]: https://github.com/DavidAnson/markdownlint
[markdownlint-config]: https://github.com/DavidAnson/markdownlint/blob/main/README.md#optionsconfig
[markdownlint-configuration]: https://github.com/DavidAnson/markdownlint/blob/main/README.md#configuration
[markdownlint-custom-rules]: https://github.com/DavidAnson/markdownlint/blob/main/doc/CustomRules.md
[markdownlint-options]: https://github.com/DavidAnson/markdownlint/blob/main/README.md#options
[markdownlint-rules-aliases]: https://github.com/DavidAnson/markdownlint/blob/main/README.md#rules--aliases
[markdownlint-rules-tags]: https://github.com/DavidAnson/markdownlint/blob/main/README.md#tags
[markdownlint-config]: https://github.com/DavidAnson/markdownlint/blob/v0.32.1/README.md#optionsconfig
[markdownlint-configuration]: https://github.com/DavidAnson/markdownlint/blob/v0.32.1/README.md#configuration
[markdownlint-custom-rules]: https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/CustomRules.md
[markdownlint-options]: https://github.com/DavidAnson/markdownlint/blob/v0.32.1/README.md#options
[markdownlint-rules-aliases]: https://github.com/DavidAnson/markdownlint/blob/v0.32.1/README.md#rules--aliases
[markdownlint-rules-tags]: https://github.com/DavidAnson/markdownlint/blob/v0.32.1/README.md#tags
[markdownlint-cli]: https://github.com/igorshubovych/markdownlint-cli
[markdownlint-cli2]: https://github.com/DavidAnson/markdownlint-cli2
[markdownlint-cli2-action]: https://github.com/marketplace/actions/markdownlint-cli2-action
Expand All @@ -471,10 +471,10 @@ See [CHANGELOG.md][changelog].
[markdownlint-cli2-mjs]: test/markdownlint-cli2-mjs/.markdownlint-cli2.mjs
[markdownlint-cli2-yaml]: test/markdownlint-cli2-yaml-example/.markdownlint-cli2.yaml
[markdownlint-cjs]: test/markdownlint-cjs/.markdownlint.cjs
[markdownlint-jsonc]: https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.jsonc
[markdownlint-jsonc]: https://github.com/DavidAnson/markdownlint/blob/v0.32.1/schema/.markdownlint.jsonc
[markdownlint-mjs]: test/markdownlint-mjs/.markdownlint.mjs
[markdownlint-rule]: https://www.npmjs.com/search?q=keywords:markdownlint-rule
[markdownlint-yaml]: https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml
[markdownlint-yaml]: https://github.com/DavidAnson/markdownlint/blob/v0.32.1/schema/.markdownlint.yaml
[nodejs]: https://nodejs.org/
[nodejs-docker]: https://github.com/nodejs/docker-node
[nodejs-docker-non-root]: https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#non-root-user
Expand Down
2 changes: 1 addition & 1 deletion doc/OutputFormatters.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ For a `.markdownlint-cli2.jsonc` like:
[formatter-junit]: ../formatter-junit/markdownlint-cli2-formatter-junit.js
[formatter-sarif]: ../formatter-sarif/markdownlint-cli2-formatter-sarif.js
[markdownlint-cli2-formatter]: https://www.npmjs.com/search?q=keywords:markdownlint-cli2-formatter
[markdownlint-d-ts]: https://github.com/DavidAnson/markdownlint/blob/main/lib/markdownlint.d.ts
[markdownlint-d-ts]: https://github.com/DavidAnson/markdownlint/blob/v0.32.1/lib/markdownlint.d.ts
5 changes: 3 additions & 2 deletions schema/markdownlint-cli2-config-schema.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/v0.11.0/schema/markdownlint-cli2-config-schema.json",
"title": "markdownlint-cli2 configuration schema",
"type": "object",
"properties": {
"$schema": {
"description": "JSON Schema URI (used by some editors)",
"description": "JSON Schema URI (expected by some editors)",
"type": "string",
"default": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/main/schema/markdownlint-cli2-config-schema.json"
"default": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/v0.11.0/schema/markdownlint-cli2-config-schema.json"
},
"config": {
"description": "markdownlint-cli2 configuration schema",
Expand Down
18 changes: 6 additions & 12 deletions test/markdownlint-cli2-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@ const { "main": markdownlintCli2 } = require("../markdownlint-cli2.js");
const FsMock = require("./fs-mock");

const jsonSchemaVersion = "http://json-schema.org/draft-07/schema#";
const markdownlintConfigSchemaUri = "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/main/schema/markdownlint-config-schema.json";
const markdownlintConfigSchemaDefinition =
require("../schema/markdownlint-config-schema.json");
const markdownlintCli2ConfigSchemaUri = "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/main/schema/markdownlint-cli2-config-schema.json";
const markdownlintCli2ConfigSchemaDefinition =
require("../schema/markdownlint-cli2-config-schema.json");
const markdownlintConfigSchemaUri = "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/v0.11.0/schema/markdownlint-config-schema.json";
const markdownlintConfigSchemaDefinition = require("../schema/markdownlint-config-schema.json");
const markdownlintCli2ConfigSchemaDefinition = require("../schema/markdownlint-cli2-config-schema.json");

const outputFormatterLengthIs = (t, length) => (options) => {
const { results } = options;
Expand Down Expand Up @@ -121,12 +118,9 @@ test("validateMarkdownlintCli2ConfigSchema", async (t) => {
// Validate instances
// @ts-ignore
addSchema(markdownlintConfigSchemaDefinition, markdownlintConfigSchemaUri);
addSchema(
// @ts-ignore
markdownlintCli2ConfigSchemaDefinition,
markdownlintCli2ConfigSchemaUri
);
const validateConfigSchema = await validate(markdownlintCli2ConfigSchemaUri);
// @ts-ignore
addSchema(markdownlintCli2ConfigSchemaDefinition);
const validateConfigSchema = await validate(markdownlintCli2ConfigSchemaDefinition.$id);
const { "default": stripJsonComments } = await import("strip-json-comments");
const { globby } = await import("globby");
const files = await globby(
Expand Down

0 comments on commit 04c26d8

Please sign in to comment.