@markuplint/vue-parser 3.3.1 → 3.5.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/lib/attr.js CHANGED
@@ -2,7 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.attr = void 0;
4
4
  const duplicatableAttrs = ['class', 'style'];
5
- function attr(attr) {
5
+ function attr(
6
+ // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
7
+ attr) {
6
8
  if (attr.type !== 'html-attr') {
7
9
  const name = attr.potentialName;
8
10
  if (duplicatableAttrs.includes(name)) {
package/lib/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { parse } from './parse';
2
- export declare const endTag = 'xml';
2
+ export declare const endTag = "xml";
package/lib/parse.js CHANGED
@@ -30,14 +30,14 @@ const parse = (rawCode, options) => {
30
30
  };
31
31
  }
32
32
  const nodeList = ast.templateBody
33
- ? (0, html_parser_1.flattenNodes)(traverse(ast.templateBody, null, rawCode, options), rawCode)
33
+ ? (0, parser_utils_1.flattenNodes)(traverse(ast.templateBody, null, rawCode, options), rawCode)
34
34
  : [];
35
35
  // Remove `</template>`
36
36
  const templateEndTagIndex = nodeList.findIndex(node => /\s*<\/\s*template\s*>\s*/i.test(node.raw));
37
37
  if (templateEndTagIndex !== -1) {
38
38
  const templateEndTag = nodeList[templateEndTagIndex];
39
39
  for (const node of nodeList) {
40
- if (node.nextNode && node.nextNode.uuid === templateEndTag.uuid) {
40
+ if (node.nextNode && node.nextNode.uuid === (templateEndTag === null || templateEndTag === void 0 ? void 0 : templateEndTag.uuid)) {
41
41
  node.nextNode = null;
42
42
  }
43
43
  }
@@ -49,7 +49,9 @@ const parse = (rawCode, options) => {
49
49
  };
50
50
  };
51
51
  exports.parse = parse;
52
- function traverse(rootNode, parentNode = null, rawHtml, options) {
52
+ function traverse(
53
+ // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
54
+ rootNode, parentNode = null, rawHtml, options) {
53
55
  const nodeList = [];
54
56
  if (rootNode.type !== 'VElement') {
55
57
  return [];
@@ -71,7 +73,13 @@ function traverse(rootNode, parentNode = null, rawHtml, options) {
71
73
  }
72
74
  return nodeList;
73
75
  }
74
- function nodeize(originNode, prevNode, parentNode, rawHtml, options) {
76
+ function nodeize(
77
+ // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
78
+ originNode,
79
+ // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
80
+ prevNode,
81
+ // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
82
+ parentNode, rawHtml, options) {
75
83
  const nextNode = null;
76
84
  const startOffset = originNode.range[0];
77
85
  const endOffset = originNode.range[1];
@@ -1,7 +1,4 @@
1
1
  import * as VueESLintParser from 'vue-eslint-parser';
2
2
  export type VueTokens = VueESLintParser.AST.ESLintProgram;
3
3
  export default function vueParse(vueTemplate: string): VueTokens;
4
- export type ASTNode =
5
- | VueESLintParser.AST.VElement
6
- | VueESLintParser.AST.VText
7
- | VueESLintParser.AST.VExpressionContainer;
4
+ export type ASTNode = VueESLintParser.AST.VElement | VueESLintParser.AST.VText | VueESLintParser.AST.VExpressionContainer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/vue-parser",
3
- "version": "3.3.1",
3
+ "version": "3.5.0",
4
4
  "description": "Vue parser for markuplint",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -16,11 +16,11 @@
16
16
  "clean": "tsc --build --clean"
17
17
  },
18
18
  "dependencies": {
19
- "@markuplint/html-parser": "3.3.1",
20
- "@markuplint/ml-ast": "3.0.0",
21
- "@markuplint/parser-utils": "3.3.0",
19
+ "@markuplint/html-parser": "3.5.0",
20
+ "@markuplint/ml-ast": "3.1.0",
21
+ "@markuplint/parser-utils": "3.5.0",
22
22
  "tslib": "^2.4.1",
23
23
  "vue-eslint-parser": "^9.1.0"
24
24
  },
25
- "gitHead": "f19e7de726cf01d53342bc5513c30da75d28da63"
25
+ "gitHead": "0c47b2c2722f6823a17f36edbab98486275f8ab4"
26
26
  }