...
 
Commits (4)
# html-validate changelog
## [1.9.1](https://gitlab.com/html-validate/html-validate/compare/v1.9.0...v1.9.1) (2019-09-19)
### Bug Fixes
- **rules:** fix handling of invalid void style ([4682d96](https://gitlab.com/html-validate/html-validate/commit/4682d96)), closes [#52](https://gitlab.com/html-validate/html-validate/issues/52)
# [1.9.0](https://gitlab.com/html-validate/html-validate/compare/v1.8.0...v1.9.0) (2019-09-17)
### Features
......
......@@ -50,5 +50,5 @@ This rule takes an optional object:
- `omit` requires end tag to be omitted and disallows self-closing
elements (default).
- `selfclosing` requests self-closing any void element.
- `selfclose` requests self-closing any void element.
- `any` allows both omitting and self-closing elements.
{
"name": "html-validate",
"version": "1.9.0",
"version": "1.9.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -6967,9 +6967,9 @@
}
},
"eslint-plugin-prettier": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz",
"integrity": "sha512-XWX2yVuwVNLOUhQijAkXz+rMPPoCr7WFiAl8ig6I7Xn+pPVhDhzg4DxHpmbeb0iqjO9UronEA3Tb09ChnFVHHA==",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.1.tgz",
"integrity": "sha512-A+TZuHZ0KU0cnn56/9mfR7/KjUJ9QNVXUhwvRFSR7PGPe0zQR6PTkmyqg1AtUUEOzTqeRsUwyKFh0oVZKVCrtA==",
"dev": true,
"requires": {
"prettier-linter-helpers": "^1.0.0"
......
{
"name": "html-validate",
"version": "1.9.0",
"version": "1.9.1",
"description": "html linter",
"keywords": [
"html",
......@@ -135,7 +135,7 @@
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jest": "22.17.0",
"eslint-plugin-node": "10.0.0",
"eslint-plugin-prettier": "3.1.0",
"eslint-plugin-prettier": "3.1.1",
"eslint-plugin-security": "1.4.0",
"eslint-plugin-sonarjs": "0.4.0",
"font-awesome": "4.7.0",
......
......@@ -132,17 +132,13 @@ describe("rule void", () => {
});
});
describe('configured with style="foobar"', () => {
beforeAll(() => {
htmlvalidate = new HtmlValidate({
rules: { void: ["error", { style: "foobar" }] },
});
});
it('should default to "any"', () => {
const report = htmlvalidate.validateString("<input><input/>");
expect(report).toBeValid();
it("should throw error if configured with invalid value", () => {
htmlvalidate = new HtmlValidate({
rules: { void: ["error", { style: "foobar" }] },
});
expect(() => htmlvalidate.validateString("<input>")).toThrow(
`Invalid style "foobar" for "void" rule`
);
});
it("should contain documentation", () => {
......
......@@ -95,9 +95,10 @@ function parseStyle(name: string): Style {
case "omit":
return Style.AlwaysOmit;
case "selfclose":
case "selfclosing":
return Style.AlwaysSelfclose;
default:
return Style.Any;
throw new Error(`Invalid style "${name}" for "void" rule`);
}
}
......