mirror of
https://github.com/theoludwig/html-w3c-validator.git
synced 2024-12-08 00:45:37 +01:00
feat: add config JSON schema
This commit is contained in:
parent
09731d4749
commit
8934ac1b7a
@ -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"]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -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"]
|
||||||
}
|
}
|
||||||
|
47
schema/html-w3c-validatorrc-schema.json
Normal file
47
schema/html-w3c-validatorrc-schema.json
Normal 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
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/develop/schema/html-w3c-validatorrc-schema.json",
|
||||||
"urls": [],
|
"urls": [],
|
||||||
"files": []
|
"files": []
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/develop/schema/html-w3c-validatorrc-schema.json",
|
||||||
"files": "Invalid"
|
"files": "Invalid"
|
||||||
}
|
}
|
||||||
|
@ -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": []
|
||||||
}
|
}
|
||||||
|
@ -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"]
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/develop/schema/html-w3c-validatorrc-schema.json",
|
||||||
"urls": "Invalid"
|
"urls": "Invalid"
|
||||||
}
|
}
|
||||||
|
@ -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"]
|
||||||
}
|
}
|
||||||
|
@ -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"]
|
||||||
}
|
}
|
||||||
|
@ -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"]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user