mirror of
				https://github.com/theoludwig/html-w3c-validator.git
				synced 2025-05-21 23:21:29 +02:00 
			
		
		
		
	feat: add config JSON schema
This commit is contained in:
		| @@ -68,12 +68,15 @@ npm install --save-dev html-w3c-validator start-server-and-test | ||||
|  | ||||
| ```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"], | ||||
|  | ||||
|   // You can also specify HTML files instead of URLs | ||||
|   // Files to validate. | ||||
|   "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"] | ||||
| } | ||||
| ``` | ||||
|   | ||||
| @@ -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"], | ||||
|   "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": [], | ||||
|   "files": [] | ||||
| } | ||||
|   | ||||
| @@ -1,3 +1,4 @@ | ||||
| { | ||||
|   "$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/develop/schema/html-w3c-validatorrc-schema.json", | ||||
|   "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"], | ||||
|   "severities": [] | ||||
| } | ||||
|   | ||||
| @@ -1,4 +1,5 @@ | ||||
| { | ||||
|   "$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/develop/schema/html-w3c-validatorrc-schema.json", | ||||
|   "files": ["./index.html"], | ||||
|   "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" | ||||
| } | ||||
|   | ||||
| @@ -1,3 +1,4 @@ | ||||
| { | ||||
|   "$schema": "https://raw.githubusercontent.com/theoludwig/html-w3c-validator/develop/schema/html-w3c-validatorrc-schema.json", | ||||
|   "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"] | ||||
| } | ||||
|   | ||||
| @@ -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"] | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user