1
1
mirror of https://github.com/theoludwig/html-w3c-validator.git synced 2024-07-20 07:30:11 +02:00

feat: add config JSON schema

This commit is contained in:
Théo LUDWIG 2024-02-02 15:35:18 +01:00
parent 09731d4749
commit 8934ac1b7a
Signed by: theoludwig
GPG Key ID: ADFE5A563D718F3B
11 changed files with 61 additions and 2 deletions

View File

@ -68,12 +68,15 @@ npm install --save-dev html-w3c-validator start-server-and-test
```json ```json
{ {
"$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/main/schema/html-w3c-validatorrc-schema.json",
// URLs to validate.
"urls": ["http://127.0.0.1:3000/", "http://127.0.0.1:3000/about"], "urls": ["http://127.0.0.1:3000/", "http://127.0.0.1:3000/about"],
// You can also specify HTML files instead of URLs // Files to validate.
"files": ["./index.html", "./about.html"], "files": ["./index.html", "./about.html"],
// Specify the severities of the validator (default: ["warning", "error"]) // Specify the severities of the validator messages to report. (default: ["warning", "error"])
"severities": ["info", "warning", "error"] "severities": ["info", "warning", "error"]
} }
``` ```

View File

@ -1,4 +1,5 @@
{ {
"$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/develop/schema/html-w3c-validatorrc-schema.json",
"urls": ["http://127.0.0.1:3000/", "http://127.0.0.1:3000/about"], "urls": ["http://127.0.0.1:3000/", "http://127.0.0.1:3000/about"],
"files": ["./build/index.html", "./build/about.html"] "files": ["./build/index.html", "./build/about.html"]
} }

View File

@ -0,0 +1,47 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/main/schema/html-w3c-validatorrc-schema.json",
"title": "html-w3c-validator configuration schema",
"type": "object",
"properties": {
"$schema": {
"description": "JSON Schema URI",
"type": "string",
"default": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/main/schema/html-w3c-validatorrc-schema.json"
},
"urls": {
"description": "URLs to validate.",
"type": "array",
"default": [],
"minItems": 1,
"items": {
"description": "URL to validate.",
"type": "string",
"minLength": 1
}
},
"files": {
"description": "Files to validate.",
"type": "array",
"minItems": 1,
"default": [],
"items": {
"description": "File to validate.",
"type": "string",
"minLength": 1
}
},
"severities": {
"description": "Specify the severities of the validator messages to report.",
"type": "array",
"minItems": 1,
"default": ["warning", "error"],
"items": {
"description": "Severity to report.",
"type": "string",
"enum": ["error", "warning", "info"]
}
}
},
"additionalProperties": false
}

View File

@ -1,4 +1,5 @@
{ {
"$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/develop/schema/html-w3c-validatorrc-schema.json",
"urls": [], "urls": [],
"files": [] "files": []
} }

View File

@ -1,3 +1,4 @@
{ {
"$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/develop/schema/html-w3c-validatorrc-schema.json",
"files": "Invalid" "files": "Invalid"
} }

View File

@ -1,4 +1,5 @@
{ {
"$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/develop/schema/html-w3c-validatorrc-schema.json",
"files": ["./index.html"], "files": ["./index.html"],
"severities": [] "severities": []
} }

View File

@ -1,4 +1,5 @@
{ {
"$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/develop/schema/html-w3c-validatorrc-schema.json",
"files": ["./index.html"], "files": ["./index.html"],
"severities": ["errors-invalid"] "severities": ["errors-invalid"]
} }

View File

@ -1,3 +1,4 @@
{ {
"$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/develop/schema/html-w3c-validatorrc-schema.json",
"urls": "Invalid" "urls": "Invalid"
} }

View File

@ -1,3 +1,4 @@
{ {
"$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/develop/schema/html-w3c-validatorrc-schema.json",
"files": ["./index.html"] "files": ["./index.html"]
} }

View File

@ -1,3 +1,4 @@
{ {
"$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/develop/schema/html-w3c-validatorrc-schema.json",
"files": ["./build/index.html", "./build/about.html"] "files": ["./build/index.html", "./build/about.html"]
} }

View File

@ -1,3 +1,4 @@
{ {
"$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/develop/schema/html-w3c-validatorrc-schema.json",
"files": ["./build/index.html", "./build/about.html"] "files": ["./build/index.html", "./build/about.html"]
} }