html-validate 1.15.0 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # html-validate changelog
2
2
 
3
+ # [1.16.0](https://gitlab.com/html-validate/html-validate/compare/v1.15.0...v1.16.0) (2019-11-09)
4
+
5
+ ### Bug Fixes
6
+
7
+ - **cli:** fix `--init` not creating configuration unless overwriting ([9098529](https://gitlab.com/html-validate/html-validate/commit/90985293bf941c54055c93b35a6c6f865a2f65e6))
8
+ - **config:** use `readFile` to prevent unintended caching ([4864bfa](https://gitlab.com/html-validate/html-validate/commit/4864bfa26edaf77b7bf7b0f551ffe7469a803c42))
9
+
10
+ ### Features
11
+
12
+ - **shim:** expose version number in shim ([890d122](https://gitlab.com/html-validate/html-validate/commit/890d12269cfbfff7ce6b4e49e1876bb51ca7ccdd))
13
+
3
14
  # [1.15.0](https://gitlab.com/html-validate/html-validate/compare/v1.14.1...v1.15.0) (2019-11-03)
4
15
 
5
16
  ### Bug Fixes
package/build/cli/init.js CHANGED
@@ -75,7 +75,8 @@ async function init(cwd) {
75
75
  ];
76
76
  /* prompt user for questions */
77
77
  const answers = await inquirer_1.default.prompt(questions);
78
- if (!answers.write) {
78
+ /* dont overwrite configuration unless explicitly requested */
79
+ if (exists && !answers.write) {
79
80
  return Promise.reject();
80
81
  }
81
82
  /* write configuration to file */
@@ -35,8 +35,8 @@ function mergeInternal(base, rhs) {
35
35
  function loadFromFile(filename) {
36
36
  let json;
37
37
  try {
38
- // eslint-disable-next-line security/detect-non-literal-require
39
- json = require(filename);
38
+ const data = fs_1.default.readFileSync(filename, "utf-8");
39
+ json = JSON.parse(data);
40
40
  }
41
41
  catch (err) {
42
42
  throw new error_2.ConfigError(`Failed to read configuration from "${filename}"`, err);
@@ -26,11 +26,11 @@ export declare class Attribute {
26
26
  /**
27
27
  * Flag set to true if the attribute value is static.
28
28
  */
29
- readonly isStatic: boolean;
29
+ get isStatic(): boolean;
30
30
  /**
31
31
  * Flag set to true if the attribute value is dynamic.
32
32
  */
33
- readonly isDynamic: boolean;
33
+ get isDynamic(): boolean;
34
34
  /**
35
35
  * Test attribute value.
36
36
  *
@@ -25,19 +25,19 @@ export declare class DOMNode {
25
25
  /**
26
26
  * Get the text (recursive) from all child nodes.
27
27
  */
28
- readonly textContent: string;
28
+ get textContent(): string;
29
29
  append(node: DOMNode): void;
30
30
  isRootElement(): boolean;
31
31
  /**
32
32
  * Returns a DOMNode representing the first direct child node or `null` if the
33
33
  * node has no children.
34
34
  */
35
- readonly firstChild: DOMNode;
35
+ get firstChild(): DOMNode;
36
36
  /**
37
37
  * Returns a DOMNode representing the last direct child node or `null` if the
38
38
  * node has no children.
39
39
  */
40
- readonly lastChild: DOMNode;
40
+ get lastChild(): DOMNode;
41
41
  /**
42
42
  * Disable a rule for this node.
43
43
  */
@@ -28,7 +28,7 @@ export declare class HtmlElement extends DOMNode {
28
28
  /**
29
29
  * Similar to childNodes but only elements.
30
30
  */
31
- readonly childElements: HtmlElement[];
31
+ get childElements(): HtmlElement[];
32
32
  /**
33
33
  * Find the first ancestor matching a selector.
34
34
  *
@@ -52,7 +52,7 @@ export declare class HtmlElement extends DOMNode {
52
52
  /**
53
53
  * Get a list of all attributes on this node.
54
54
  */
55
- readonly attributes: Attribute[];
55
+ get attributes(): Attribute[];
56
56
  hasAttribute(key: string): boolean;
57
57
  /**
58
58
  * Get attribute.
@@ -96,11 +96,11 @@ export declare class HtmlElement extends DOMNode {
96
96
  * Return a list of all known classes on the element. Dynamic values are
97
97
  * ignored.
98
98
  */
99
- readonly classList: DOMTokenList;
100
- readonly id: string;
101
- readonly siblings: HtmlElement[];
102
- readonly previousSibling: HtmlElement;
103
- readonly nextSibling: HtmlElement;
99
+ get classList(): DOMTokenList;
100
+ get id(): string;
101
+ get siblings(): HtmlElement[];
102
+ get previousSibling(): HtmlElement;
103
+ get nextSibling(): HtmlElement;
104
104
  getElementsByTagName(tagName: string): HtmlElement[];
105
105
  querySelector(selector: string): HtmlElement;
106
106
  querySelectorAll(selector: string): HtmlElement[];
@@ -18,13 +18,13 @@ export declare class TextNode extends DOMNode {
18
18
  /**
19
19
  * Get the text from node.
20
20
  */
21
- readonly textContent: string;
21
+ get textContent(): string;
22
22
  /**
23
23
  * Flag set to true if the attribute value is static.
24
24
  */
25
- readonly isStatic: boolean;
25
+ get isStatic(): boolean;
26
26
  /**
27
27
  * Flag set to true if the attribute value is dynamic.
28
28
  */
29
- readonly isDynamic: boolean;
29
+ get isDynamic(): boolean;
30
30
  }
@@ -203,7 +203,6 @@ class Engine {
203
203
  for (const rule of rules) {
204
204
  rule.setEnabled(true);
205
205
  }
206
- return;
207
206
  }
208
207
  });
209
208
  }
package/build/rule.d.ts CHANGED
@@ -35,7 +35,7 @@ export declare abstract class Rule<T = any> {
35
35
  *
36
36
  * Overridden by subclasses.
37
37
  */
38
- readonly deprecated: boolean;
38
+ get deprecated(): boolean;
39
39
  /**
40
40
  * Test if rule is enabled.
41
41
  *
@@ -14,7 +14,6 @@ class DeprecatedRule extends rule_1.Rule {
14
14
  for (const rule of this.getDeprecatedRules(event)) {
15
15
  if (rule.getSeverity() > config_1.Severity.DISABLED) {
16
16
  this.report(null, `Usage of deprecated rule "${rule.name}"`);
17
- continue;
18
17
  }
19
18
  }
20
19
  });
package/build/shim.d.ts CHANGED
@@ -7,3 +7,4 @@ export { Rule } from "./rule";
7
7
  export { Source, Location } from "./context";
8
8
  export { Reporter, Message, Result } from "./reporter";
9
9
  export { TemplateExtractor } from "./transform/template";
10
+ export declare const version: any;
package/build/shim.js CHANGED
@@ -18,3 +18,5 @@ var reporter_1 = require("./reporter");
18
18
  exports.Reporter = reporter_1.Reporter;
19
19
  var template_1 = require("./transform/template");
20
20
  exports.TemplateExtractor = template_1.TemplateExtractor;
21
+ const pkg = require("../package.json");
22
+ exports.version = pkg.version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-validate",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "description": "html linter",
5
5
  "keywords": [
6
6
  "html",
@@ -113,26 +113,26 @@
113
113
  "minimist": "^1.2.0"
114
114
  },
115
115
  "devDependencies": {
116
- "@babel/core": "7.6.4",
117
- "@babel/preset-env": "7.6.3",
116
+ "@babel/core": "7.7.2",
117
+ "@babel/preset-env": "7.7.1",
118
118
  "@commitlint/cli": "8.2.0",
119
119
  "@commitlint/config-conventional": "8.2.0",
120
120
  "@semantic-release/changelog": "3.0.5",
121
121
  "@semantic-release/exec": "3.3.8",
122
- "@semantic-release/git": "7.0.17",
123
- "@semantic-release/gitlab": "4.0.3",
124
- "@semantic-release/npm": "5.3.2",
122
+ "@semantic-release/git": "7.0.18",
123
+ "@semantic-release/gitlab": "4.0.4",
124
+ "@semantic-release/npm": "5.3.4",
125
125
  "@semantic-release/release-notes-generator": "7.3.2",
126
126
  "@types/babel__code-frame": "7.0.1",
127
127
  "@types/estree": "0.0.39",
128
128
  "@types/glob": "7.1.1",
129
129
  "@types/inquirer": "6.5.0",
130
- "@types/jest": "24.0.21",
130
+ "@types/jest": "24.0.22",
131
131
  "@types/json-merge-patch": "0.0.4",
132
132
  "@types/minimist": "1.2.0",
133
133
  "@types/node": "11.15.2",
134
- "@typescript-eslint/eslint-plugin": "2.6.0",
135
- "@typescript-eslint/parser": "2.6.0",
134
+ "@typescript-eslint/eslint-plugin": "2.6.1",
135
+ "@typescript-eslint/parser": "2.6.1",
136
136
  "autoprefixer": "9.7.1",
137
137
  "babelify": "10.0.0",
138
138
  "bootstrap-sass": "3.4.1",
@@ -144,11 +144,11 @@
144
144
  "eslint-config-sidvind": "1.3.2",
145
145
  "eslint-plugin-array-func": "3.1.3",
146
146
  "eslint-plugin-import": "2.18.2",
147
- "eslint-plugin-jest": "23.0.2",
147
+ "eslint-plugin-jest": "23.0.3",
148
148
  "eslint-plugin-node": "10.0.0",
149
149
  "eslint-plugin-prettier": "3.1.1",
150
150
  "eslint-plugin-security": "1.4.0",
151
- "eslint-plugin-sonarjs": "0.4.0",
151
+ "eslint-plugin-sonarjs": "0.5.0",
152
152
  "font-awesome": "4.7.0",
153
153
  "grunt": "1.0.4",
154
154
  "grunt-browserify": "5.3.0",
@@ -168,13 +168,13 @@
168
168
  "minimatch": "3.0.4",
169
169
  "prettier": "1.18.2",
170
170
  "sass": "1.23.3",
171
- "semantic-release": "15.13.28",
171
+ "semantic-release": "15.13.30",
172
172
  "serve-static": "1.14.1",
173
173
  "strip-ansi": "5.2.0",
174
174
  "ts-jest": "24.1.0",
175
- "tslint": "5.20.0",
175
+ "tslint": "5.20.1",
176
176
  "tslint-config-prettier": "1.18.0",
177
- "typescript": "3.6.4"
177
+ "typescript": "3.7.2"
178
178
  },
179
179
  "jest": {
180
180
  "collectCoverage": true,