Commits (12)
build/
node_modules/
public/assets/
......@@ -7,9 +7,6 @@
"@html-validate",
"plugin:array-func/recommended",
"plugin:node/recommended-module",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:security/recommended",
"plugin:sonarjs/recommended"
],
......
# html-validate changelog
# [2.16.0](https://gitlab.com/html-validate/html-validate/compare/v2.15.0...v2.16.0) (2020-02-12)
### Bug Fixes
- **cli:** fix typo when using `--init` with vuejs ([6eee478](https://gitlab.com/html-validate/html-validate/commit/6eee47872e164b16e4152f309ab5971019222ff9))
- **dom:** `querySelector` and friends return empty when selector is empty ([6a871de](https://gitlab.com/html-validate/html-validate/commit/6a871de7bb240507693d266b37c6e4f9228b7e5e))
- **schema:** add title and description to most properties ([a7cea78](https://gitlab.com/html-validate/html-validate/commit/a7cea78ed39643e5808cfd08243f492a235200e7))
- **schema:** handle `$schema` in config and elements ([a4f9054](https://gitlab.com/html-validate/html-validate/commit/a4f90541c74070f30d033827789336ad27063b3a))
- add missing `jest.js` and `jest.d.ts` ([8b767c2](https://gitlab.com/html-validate/html-validate/commit/8b767c2032297b8534c7feac98414fc4d90c5bd2))
### Features
- add import `html-validate/jest` as a shortcut to the jest matchers ([4ccf6ed](https://gitlab.com/html-validate/html-validate/commit/4ccf6ed6b1da47d44bb256db4156edbdbb1ddf4e))
- expose `NodeClosed`, `TextNode`, `Plugin` and `Parser` ([f344527](https://gitlab.com/html-validate/html-validate/commit/f3445274d4e713e2c851bd524ebb429da9408abb))
# [2.15.0](https://gitlab.com/html-validate/html-validate/compare/v2.14.0...v2.15.0) (2020-02-09)
### Features
......
const path = require("canonical-path");
const Package = require("dgeni").Package;
const packagePath = __dirname;
module.exports = new Package("html-validate-docs", [
......
/* eslint-disable @typescript-eslint/no-empty-function */
const path = require("canonical-path");
const packagePath = __dirname;
const Package = require("dgeni").Package;
......
......@@ -67,6 +67,7 @@ module.exports = function parseValidatesProcessor(
function readElements(fileInfo, filename) {
if (!filename) return filename;
const dir = path.dirname(fileInfo.filePath);
/* eslint-disable-next-line import/no-dynamic-require */
return require(`${dir}/${filename}`);
}
......
const chalk = require("chalk");
const HtmlValidate = require("../../../../build/htmlvalidate").default;
const codeframe = require("../../../../build/formatters/codeframe");
const chalk = require("chalk");
module.exports = function generateValidationResultsProcessor(log, validateMap) {
return {
......
const path = require("canonical-path");
const packagePath = __dirname;
const Package = require("dgeni").Package;
......
......@@ -7,10 +7,10 @@ title: Usage with Jest
`html-validate` comes with Jest support built-in.
In you test import `matchers`:
In you test import `html-validate/jest`:
```js
import "html-validate/build/matchers";
import "html-validate/jest";
```
This makes all the custom matchers available.
......@@ -50,6 +50,8 @@ If you need to override this (perhaps because the test-case isn't in the same fo
expect("<p></i>").toHTMLValidate(null, "path/to/my-file.html");
```
This can also be used to apply transformations to the markup.
Additionally, the `root` configuration property can be used to skip loading from `.htmlvalidate.json` but remember to actually include the rules you need:
```js
......
/* eslint-disable-next-line import/export, import/no-unresolved */
export * from "./build/matchers";
module.exports = require("./build/matchers");
{
"name": "html-validate",
"version": "2.15.0",
"version": "2.16.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -1973,15 +1973,16 @@
}
},
"@html-validate/eslint-config": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/@html-validate/eslint-config/-/eslint-config-1.0.9.tgz",
"integrity": "sha512-5SzmdQLGPgHJEVz2/IdCFWDwovISCdLG5PovYaXfLKQzWLSCXZktIhIJABHh53Z2FxVRI0EKl9ed2Rd1Z7pZQQ==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@html-validate/eslint-config/-/eslint-config-1.1.0.tgz",
"integrity": "sha512-H8ujPMr3n6U9XKGgJnSzH6CsXSLvu5LAOypGxXSX4Tj/hoSHg+cJRLwzoVSypkngxsINx7C5GMNOCP8ypcjR1g==",
"dev": true,
"requires": {
"@typescript-eslint/eslint-plugin": "^2.12.0",
"@typescript-eslint/parser": "^2.12.0",
"eslint-config-prettier": "^6.7.0",
"eslint-config-sidvind": "^1.3.2",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jest": "^23.1.1",
"eslint-plugin-prettier": "^3.1.2"
}
......@@ -4180,12 +4181,12 @@
"dev": true
},
"@typescript-eslint/eslint-plugin": {
"version": "2.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.18.0.tgz",
"integrity": "sha512-kuO8WQjV+RCZvAXVRJfXWiJ8iYEtfHlKgcqqqXg9uUkIolEHuUaMmm8/lcO4xwCOtaw6mY0gStn2Lg4/eUXXYQ==",
"version": "2.19.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.19.2.tgz",
"integrity": "sha512-HX2qOq2GOV04HNrmKnTpSIpHjfl7iwdXe3u/Nvt+/cpmdvzYvY0NHSiTkYN257jHnq4OM/yo+OsFgati+7LqJA==",
"dev": true,
"requires": {
"@typescript-eslint/experimental-utils": "2.18.0",
"@typescript-eslint/experimental-utils": "2.19.2",
"eslint-utils": "^1.4.3",
"functional-red-black-tree": "^1.0.1",
"regexpp": "^3.0.0",
......@@ -4193,20 +4194,20 @@
},
"dependencies": {
"@typescript-eslint/experimental-utils": {
"version": "2.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.18.0.tgz",
"integrity": "sha512-J6MopKPHuJYmQUkANLip7g9I82ZLe1naCbxZZW3O2sIxTiq/9YYoOELEKY7oPg0hJ0V/AQ225h2z0Yp+RRMXhw==",
"version": "2.19.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.19.2.tgz",
"integrity": "sha512-B88QuwT1wMJR750YvTJBNjMZwmiPpbmKYLm1yI7PCc3x0NariqPwqaPsoJRwU9DmUi0cd9dkhz1IqEnwfD+P1A==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.3",
"@typescript-eslint/typescript-estree": "2.18.0",
"@typescript-eslint/typescript-estree": "2.19.2",
"eslint-scope": "^5.0.0"
}
},
"@typescript-eslint/typescript-estree": {
"version": "2.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.18.0.tgz",
"integrity": "sha512-gVHylf7FDb8VSi2ypFuEL3hOtoC4HkZZ5dOjXvVjoyKdRrvXAOPSzpNRnKMfaUUEiSLP8UF9j9X9EDLxC0lfZg==",
"version": "2.19.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.19.2.tgz",
"integrity": "sha512-Xu/qa0MDk6upQWqE4Qy2X16Xg8Vi32tQS2PR0AvnT/ZYS4YGDvtn2MStOh5y8Zy2mg4NuL06KUHlvCh95j9C6Q==",
"dev": true,
"requires": {
"debug": "^4.1.1",
......@@ -4310,32 +4311,32 @@
}
},
"@typescript-eslint/parser": {
"version": "2.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.18.0.tgz",
"integrity": "sha512-SJJPxFMEYEWkM6pGfcnjLU+NJIPo+Ko1QrCBL+i0+zV30ggLD90huEmMMhKLHBpESWy9lVEeWlQibweNQzyc+A==",
"version": "2.19.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.19.2.tgz",
"integrity": "sha512-8uwnYGKqX9wWHGPGdLB9sk9+12sjcdqEEYKGgbS8A0IvYX59h01o8os5qXUHMq2na8vpDRaV0suTLM7S8wraTA==",
"dev": true,
"requires": {
"@types/eslint-visitor-keys": "^1.0.0",
"@typescript-eslint/experimental-utils": "2.18.0",
"@typescript-eslint/typescript-estree": "2.18.0",
"@typescript-eslint/experimental-utils": "2.19.2",
"@typescript-eslint/typescript-estree": "2.19.2",
"eslint-visitor-keys": "^1.1.0"
},
"dependencies": {
"@typescript-eslint/experimental-utils": {
"version": "2.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.18.0.tgz",
"integrity": "sha512-J6MopKPHuJYmQUkANLip7g9I82ZLe1naCbxZZW3O2sIxTiq/9YYoOELEKY7oPg0hJ0V/AQ225h2z0Yp+RRMXhw==",
"version": "2.19.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.19.2.tgz",
"integrity": "sha512-B88QuwT1wMJR750YvTJBNjMZwmiPpbmKYLm1yI7PCc3x0NariqPwqaPsoJRwU9DmUi0cd9dkhz1IqEnwfD+P1A==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.3",
"@typescript-eslint/typescript-estree": "2.18.0",
"@typescript-eslint/typescript-estree": "2.19.2",
"eslint-scope": "^5.0.0"
}
},
"@typescript-eslint/typescript-estree": {
"version": "2.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.18.0.tgz",
"integrity": "sha512-gVHylf7FDb8VSi2ypFuEL3hOtoC4HkZZ5dOjXvVjoyKdRrvXAOPSzpNRnKMfaUUEiSLP8UF9j9X9EDLxC0lfZg==",
"version": "2.19.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.19.2.tgz",
"integrity": "sha512-Xu/qa0MDk6upQWqE4Qy2X16Xg8Vi32tQS2PR0AvnT/ZYS4YGDvtn2MStOh5y8Zy2mg4NuL06KUHlvCh95j9C6Q==",
"dev": true,
"requires": {
"debug": "^4.1.1",
......@@ -8221,6 +8222,12 @@
"resolved": "https://registry.npmjs.org/espree/-/espree-2.2.5.tgz",
"integrity": "sha1-32kbkxCIlAKuspzAZnCMVmkLhUs=",
"dev": true
},
"marked": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz",
"integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==",
"dev": true
}
}
},
......@@ -15821,9 +15828,9 @@
}
},
"marked": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz",
"integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==",
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.8.0.tgz",
"integrity": "sha512-MyUe+T/Pw4TZufHkzAfDj6HarCBWia2y27/bhuYkTaiUnfDYFnCP3KUN+9oM7Wi6JA2rymtVYbQu3spE0GCmxQ==",
"dev": true
},
"marked-terminal": {
......
{
"name": "html-validate",
"version": "2.15.0",
"version": "2.16.0",
"description": "html linter",
"keywords": [
"html",
......@@ -29,6 +29,7 @@
"bin",
"build",
"elements",
"jest.{js,d.ts}",
"!*.snap",
"!*.spec.d.ts",
"!*.spec.js",
......@@ -43,8 +44,8 @@
"compatibility": "scripts/compatibility.sh",
"commitlint": "commitlint",
"debug": "node --inspect ./node_modules/.bin/jest --runInBand --watch --no-coverage",
"eslint": "eslint *.js '{docs,elements,src}/**/*.{js,ts}'",
"eslint:fix": "eslint --fix *.js '{docs,elements,src}/**/*.{js,ts}'",
"eslint": "eslint --ext js,ts .",
"eslint:fix": "eslint --ext js,ts . --fix",
"htmlvalidate": "./bin/html-validate.js",
"lint": "npm run eslint && npm run tslint",
"prettier:check": "prettier '**/*.{ts,js,json,md,scss}' --list-different",
......@@ -98,7 +99,7 @@
"@babel/preset-env": "7.8.4",
"@commitlint/cli": "8.3.5",
"@html-validate/commitlint-config": "1.0.1",
"@html-validate/eslint-config": "1.0.9",
"@html-validate/eslint-config": "1.1.0",
"@html-validate/prettier-config": "1.0.0",
"@html-validate/semantic-release-config": "1.0.8",
"@types/babel__code-frame": "7.0.1",
......@@ -118,8 +119,6 @@
"dgeni-front-matter": "1.0.2",
"dgeni-packages": "0.28.2",
"eslint-plugin-array-func": "3.1.3",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-jest": "23.7.0",
"eslint-plugin-node": "11.0.0",
"eslint-plugin-security": "1.4.0",
"eslint-plugin-sonarjs": "0.5.0",
......@@ -140,11 +139,13 @@
"jquery": "3.4.1",
"lint-staged": "10.0.7",
"load-grunt-tasks": "5.1.0",
"marked": "0.8.0",
"minimatch": "3.0.4",
"prettier": "1.19.1",
"sass": "1.25.0",
"semantic-release": "17.0.2",
"serve-static": "1.14.1",
"stringmap": "0.2.2",
"strip-ansi": "6.0.0",
"ts-jest": "25.2.0",
"tslint": "5.20.1",
......
import path from "path";
let mockDirectory: string[] = [];
function setMockDirectories(directories: string[]): void {
......
......@@ -22,7 +22,7 @@ exports[`should generate configuration for combined 1`] = `
],
\\"extends\\": [
\\"html-validate:recommended\\",
\\"html-valudate-vue:recommended\\"
\\"html-validate-vue:recommended\\"
],
\\"transform\\": {
\\"^.*\\\\\\\\.js$\\": \\"html-validate-angular/js\\",
......@@ -68,7 +68,7 @@ exports[`should generate configuration for vuejs 1`] = `
],
\\"extends\\": [
\\"html-validate:recommended\\",
\\"html-valudate-vue:recommended\\"
\\"html-validate-vue:recommended\\"
],
\\"plugins\\": [
\\"html-validate-vue\\"
......
import fs from "fs";
import glob from "glob";
import path from "path";
import glob from "glob";
const DEFAULT_EXTENSIONS = ["html"];
......
......@@ -28,6 +28,7 @@ export function getFormatter(formatters: string): (report: Report) => string {
const fn: WrappedFormatter[] = formatters.split(",").map(cur => {
const [name, dst] = cur.split("=", 2);
const moduleName = name.replace(/[^a-z]+/g, "");
/* eslint-disable-next-line import/no-dynamic-require */
const formatter = require(`../formatters/${moduleName}`);
return wrap(formatter, dst);
});
......
/* eslint-disable no-console, no-process-exit, sonarjs/no-duplicate-string */
import path from "path";
import chalk from "chalk";
import minimist from "minimist";
import { TokenDump } from "../engine";
import { SchemaValidationError } from "../error";
import { UserError } from "../error/user-error";
import { Report, Reporter, Result } from "../reporter";
import { eventFormatter } from "./json";
const pkg = require("../../package.json");
import chalk from "chalk";
import minimist from "minimist";
import path from "path";
import { CLI } from "./cli";
const pkg = require("../../package.json");
enum Mode {
LINT,
INIT,
......
import { CLI } from "./cli";
export default CLI;
import deepmerge from "deepmerge";
import fs from "fs";
import deepmerge from "deepmerge";
import inquirer from "inquirer";
import { ConfigData } from "../config";
......@@ -22,7 +22,7 @@ const frameworkConfig: Record<string, ConfigData> = {
},
[Frameworks.vuejs]: {
plugins: ["html-validate-vue"],
extends: ["html-valudate-vue:recommended"],
extends: ["html-validate-vue:recommended"],
transform: {
"^.*\\.vue$": "html-validate-vue",
},
......