Commit f6afc0fd authored by David Sveningsson's avatar David Sveningsson

feat(rules): mark `void` as deprecated

replaced with `void-element`, `void-style` and `no-self-closing`.

fixes #58
parent d9c869b3
......@@ -12,6 +12,8 @@ cannot have any content and must not have an end tag.
Foreign elements will always be ignored by this rule.
**Deprecated:** This rule is deprecated. It has been replaced by the rules {@link void-content}, {@link void-style} and {@link no-self-closing}.
## Rule details
Examples of **incorrect** code for this rule:
......
......@@ -350,11 +350,11 @@ Array [
"messages": Array [
Object {
"column": 6,
"context": undefined,
"context": "br",
"line": 2,
"message": "End tag for <br> must be omitted",
"offset": 49,
"ruleId": "void",
"ruleId": "void-content",
"selector": null,
"severity": 2,
"size": 3,
......@@ -392,11 +392,11 @@ Array [
"messages": Array [
Object {
"column": 6,
"context": undefined,
"context": "br",
"line": 2,
"message": "End tag for <br> must be omitted",
"offset": 42,
"ruleId": "void",
"ruleId": "void-content",
"selector": null,
"severity": 2,
"size": 3,
......@@ -452,11 +452,11 @@ Array [
"messages": Array [
Object {
"column": 6,
"context": undefined,
"context": "br",
"line": 2,
"message": "End tag for <br> must be omitted",
"offset": 44,
"ruleId": "void",
"ruleId": "void-content",
"selector": null,
"severity": 1,
"size": 3,
......
......@@ -36,7 +36,7 @@ module.exports = {
"prefer-tbody": "error",
"svg-focusable": "error",
"unrecognized-char-ref": "error",
void: "error",
void: "off",
"void-content": "error",
"void-style": "error",
"wcag/h30": "error",
......
......@@ -76,9 +76,7 @@ describe("Engine", () => {
config = Config.fromObject({
extends: ["html-validate:recommended"],
rules: {
deprecated: "off",
void: "off",
"void-content": "off",
deprecated: "off"
},
});
config.init();
......
......@@ -21,6 +21,10 @@ const defaults: RuleOptions = {
class Void extends Rule<void, RuleOptions> {
private style: Style;
public get deprecated(): boolean {
return true;
}
public documentation(): RuleDocumentation {
return {
description:
......
{
"root": true,
"rules": {
"void": "error",
"void-content": "off"
"void-content": "error"
}
}
......@@ -2,7 +2,6 @@
"rules": {
"deprecated": "error",
"element-permitted-content": "off",
"no-self-closing": "error",
"void": "off"
"no-self-closing": "error"
}
}
{
"rules": {
"void": "off"
"void-content": "off"
}
}
{
"rules": {
"void": "error"
"void-content": "error"
}
}
{
"rules": {
"void": "warn"
"void-content": "warn"
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment