@markuplint/vue-parser 4.0.2 → 4.1.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/parser.d.ts CHANGED
@@ -22,6 +22,19 @@ declare class VueParser extends Parser<ASTNode, State> {
22
22
  }) | (import("@markuplint/ml-ast").MLASTSpreadAttr & {
23
23
  __rightText?: string | undefined;
24
24
  });
25
+ /**
26
+ * > In SFCs, it's recommended to use `PascalCase` tag names
27
+ * > for child components to differentiate from native HTML elements.
28
+ * > Although native HTML tag names are case-insensitive,
29
+ * > Vue SFC is a compiled format so we are able to use case-sensitive tag names in it.
30
+ * > We are also able to use `/>` to close a tag.
31
+ *
32
+ * @see https://vuejs.org/guide/essentials/component-basics#using-a-component
33
+ * @see https://vuejs.org/api/built-in-components.html
34
+ * @see https://vuejs.org/api/built-in-special-elements.html#built-in-special-elements
35
+ * @param nodeName
36
+ * @returns
37
+ */
25
38
  detectElementType(nodeName: string): import("@markuplint/ml-ast").ElementType;
26
39
  }
27
40
  export declare const parser: VueParser;
package/lib/parser.js CHANGED
@@ -204,15 +204,30 @@ class VueParser extends Parser {
204
204
  }
205
205
  return attr;
206
206
  }
207
+ /**
208
+ * > In SFCs, it's recommended to use `PascalCase` tag names
209
+ * > for child components to differentiate from native HTML elements.
210
+ * > Although native HTML tag names are case-insensitive,
211
+ * > Vue SFC is a compiled format so we are able to use case-sensitive tag names in it.
212
+ * > We are also able to use `/>` to close a tag.
213
+ *
214
+ * @see https://vuejs.org/guide/essentials/component-basics#using-a-component
215
+ * @see https://vuejs.org/api/built-in-components.html
216
+ * @see https://vuejs.org/api/built-in-special-elements.html#built-in-special-elements
217
+ * @param nodeName
218
+ * @returns
219
+ */
207
220
  detectElementType(nodeName) {
208
221
  return super.detectElementType(nodeName, [
209
- 'component',
210
- 'slot',
222
+ // Built-in components
211
223
  'Transition',
212
224
  'TransitionGroup',
213
225
  'KeepAlive',
214
226
  'Teleport',
215
227
  'Suspense',
228
+ // Special elements
229
+ 'component',
230
+ 'slot',
216
231
  // Backward compatibility
217
232
  /^[A-Z]/,
218
233
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/vue-parser",
3
- "version": "4.0.2",
3
+ "version": "4.1.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>",
@@ -21,10 +21,10 @@
21
21
  "clean": "tsc --build --clean"
22
22
  },
23
23
  "dependencies": {
24
- "@markuplint/html-parser": "4.0.1",
24
+ "@markuplint/html-parser": "4.1.0",
25
25
  "@markuplint/ml-ast": "4.0.1",
26
- "@markuplint/parser-utils": "4.0.1",
26
+ "@markuplint/parser-utils": "4.1.0",
27
27
  "vue-eslint-parser": "^9.4.2"
28
28
  },
29
- "gitHead": "bf84b391b580a8586fa7acaf56eb2e8114c8e33e"
29
+ "gitHead": "b9817c30c2df71faa866e3b3fe286afa499deede"
30
30
  }