feat: use go tool
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
# Validating Configuration
|
||||
|
||||
A [JSON Schema][json-schema] is provided to enable validating options objects:
|
||||
[`markdownlint-cli2-config-schema.json`][markdownlint-cli2-config-schema]
|
||||
|
||||
Some editors automatically use a JSON Schema with files that reference it. For
|
||||
example, a `.markdownlint-cli2.jsonc` file with:
|
||||
|
||||
```json
|
||||
"$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/main/schema/markdownlint-cli2-config-schema.json"
|
||||
```
|
||||
|
||||
A JSON Schema validator can be used to check configuration files like so:
|
||||
|
||||
```bash
|
||||
npx ajv-cli validate -s ./markdownlint-cli2/schema/markdownlint-cli2-config-schema.json -r ./markdownlint-cli2/schema/markdownlint-config-schema.json -d "**/.markdownlint-cli2.{jsonc,yaml}" --strict=false
|
||||
```
|
||||
|
||||
A similar process is documented for validating `markdownlint` configuration
|
||||
objects: [Validating Configuration][validating-configuration].
|
||||
|
||||
[json-schema]: https://json-schema.org
|
||||
[markdownlint-cli2-config-schema]: markdownlint-cli2-config-schema.json
|
||||
[validating-configuration]: https://github.com/DavidAnson/markdownlint/blob/main/schema/ValidatingConfiguration.md
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/v0.22.1/schema/markdownlint-cli2-config-schema.json",
|
||||
"title": "markdownlint-cli2 configuration schema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"$schema": {
|
||||
"description": "JSON Schema URI (expected by some editors)",
|
||||
"type": "string",
|
||||
"default": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/v0.22.1/schema/markdownlint-cli2-config-schema.json"
|
||||
},
|
||||
"config": {
|
||||
"description": "markdownlint configuration schema : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/schema/.markdownlint.jsonc",
|
||||
"$ref": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.40.0/schema/markdownlint-config-schema.json",
|
||||
"default": {}
|
||||
},
|
||||
"customRules": {
|
||||
"description": "Module names or paths of custom rules to load and use when linting : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.22.1/README.md#markdownlint-cli2jsonc",
|
||||
"type": "array",
|
||||
"default": [],
|
||||
"items": {
|
||||
"description": "Module name or path of a custom rule",
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
}
|
||||
},
|
||||
"fix": {
|
||||
"description": "Whether to enable fixing of linting errors reported by rules that emit fix information : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.22.1/README.md#markdownlint-cli2jsonc",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"frontMatter": {
|
||||
"description": "Regular expression used to match and ignore any front matter at the beginning of a document : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.22.1/README.md#markdownlint-cli2jsonc",
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"default": ""
|
||||
},
|
||||
"gitignore": {
|
||||
"description": "Whether to ignore files referenced by .gitignore (or glob expression) (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.22.1/README.md#markdownlint-cli2jsonc",
|
||||
"type": [
|
||||
"boolean",
|
||||
"string"
|
||||
],
|
||||
"default": false
|
||||
},
|
||||
"globs": {
|
||||
"description": "Glob expressions to include when linting (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.22.1/README.md#markdownlint-cli2jsonc",
|
||||
"type": "array",
|
||||
"default": [],
|
||||
"items": {
|
||||
"description": "Glob expression of files to lint",
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
}
|
||||
},
|
||||
"ignores": {
|
||||
"description": "Glob expressions to ignore when linting : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.22.1/README.md#markdownlint-cli2jsonc",
|
||||
"type": "array",
|
||||
"default": [],
|
||||
"items": {
|
||||
"description": "Glob expression of files to ignore",
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
}
|
||||
},
|
||||
"markdownItPlugins": {
|
||||
"description": "markdown-it plugins to load and use when linting : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.22.1/README.md#markdownlint-cli2jsonc",
|
||||
"type": "array",
|
||||
"default": [],
|
||||
"items": {
|
||||
"description": "Name or path of a markdown-it plugin followed by parameters",
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"description": "Name or path of a markdown-it plugin",
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
{
|
||||
"description": "Parameter(s) to pass to the markdown-it plugin"
|
||||
}
|
||||
],
|
||||
"minItems": 1
|
||||
}
|
||||
},
|
||||
"modulePaths": {
|
||||
"description": "Additional paths to resolve module locations from : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.22.1/README.md#markdownlint-cli2jsonc",
|
||||
"type": "array",
|
||||
"default": [],
|
||||
"items": {
|
||||
"description": "Path to resolve module locations from",
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
}
|
||||
},
|
||||
"noBanner": {
|
||||
"description": "Whether to disable the display of the banner message and version numbers on stdout (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.22.1/README.md#markdownlint-cli2jsonc",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"noInlineConfig": {
|
||||
"description": "Whether to disable support of HTML comments within Markdown content : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.22.1/README.md#markdownlint-cli2jsonc",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"noProgress": {
|
||||
"description": "Whether to disable the display of progress on stdout (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.22.1/README.md#markdownlint-cli2jsonc",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"outputFormatters": {
|
||||
"description": "Output formatters to load and use to customize markdownlint-cli2 output (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.22.1/README.md#markdownlint-cli2jsonc",
|
||||
"type": "array",
|
||||
"default": [],
|
||||
"items": {
|
||||
"description": "Name or path of an output formatter followed by parameters",
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"description": "Name or path of an output formatter",
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
{
|
||||
"description": "Parameter(s) to pass to the output formatter"
|
||||
}
|
||||
],
|
||||
"minItems": 1
|
||||
}
|
||||
},
|
||||
"showFound": {
|
||||
"description": "Whether to show the list of found files on stdout (only valid at the root) : https://github.com/DavidAnson/markdownlint-cli2/blob/v0.22.1/README.md#markdownlint-cli2jsonc",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
+5133
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user