1
1
mirror of https://github.com/theoludwig/html-w3c-validator.git synced 2024-12-08 00:45:37 +01:00

BREAKING CHANGE: change default validator severities: "warning" and "error"

This commit is contained in:
Théo LUDWIG 2023-07-02 13:07:45 +02:00
parent 29203985e4
commit eb970f1823
Signed by: theoludwig
GPG Key ID: ADFE5A563D718F3B
2 changed files with 5 additions and 2 deletions

View File

@ -73,7 +73,7 @@ npm install --save-dev html-w3c-validator start-server-and-test
// You can also specify HTML files instead of URLs // You can also specify HTML files instead of URLs
"files": ["./index.html", "./about.html"], "files": ["./index.html", "./about.html"],
// Specify the severities of the validator (default: ["error"]) // Specify the severities of the validator (default: ["warning", "error"])
"severities": ["info", "warning", "error"] "severities": ["info", "warning", "error"]
} }
``` ```

View File

@ -104,7 +104,10 @@ export class HTMLValidatorCommand extends Command {
`Invalid config file at "${configPath}". Please add URLs or files.` `Invalid config file at "${configPath}". Please add URLs or files.`
) )
} }
const configSeverities: Severity[] = config.severities ?? ['error'] const configSeverities: Severity[] = config.severities ?? [
'warning',
'error'
]
for (const severity of configSeverities) { for (const severity of configSeverities) {
if (!severities.includes(severity)) { if (!severities.includes(severity)) {
throw new Error( throw new Error(