@markuplint/svelte-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 +8 -0
- package/lib/parser.js +9 -1
- package/package.json +4 -4
package/lib/parser.d.ts
CHANGED
|
@@ -47,6 +47,14 @@ declare class SvelteParser extends Parser<SvelteNode> {
|
|
|
47
47
|
endCol: number;
|
|
48
48
|
__rightText?: string | undefined;
|
|
49
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* > A lowercase tag, like `<div>`, denotes a regular HTML element.
|
|
52
|
+
* A capitalised tag, such as `<Widget>` or `<Namespace.Widget>`, indicates a component.
|
|
53
|
+
*
|
|
54
|
+
* @see https://svelte.io/docs/basic-markup#tags
|
|
55
|
+
* @param nodeName
|
|
56
|
+
* @returns
|
|
57
|
+
*/
|
|
50
58
|
detectElementType(nodeName: string): import("@markuplint/ml-ast").ElementType;
|
|
51
59
|
visitExpression(token: ChildToken, originBlockNode: SvelteNode): MLASTPreprocessorSpecificBlock[];
|
|
52
60
|
}
|
package/lib/parser.js
CHANGED
|
@@ -189,8 +189,16 @@ class SvelteParser extends Parser {
|
|
|
189
189
|
potentialName,
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* > A lowercase tag, like `<div>`, denotes a regular HTML element.
|
|
194
|
+
* A capitalised tag, such as `<Widget>` or `<Namespace.Widget>`, indicates a component.
|
|
195
|
+
*
|
|
196
|
+
* @see https://svelte.io/docs/basic-markup#tags
|
|
197
|
+
* @param nodeName
|
|
198
|
+
* @returns
|
|
199
|
+
*/
|
|
192
200
|
detectElementType(nodeName) {
|
|
193
|
-
return super.detectElementType(nodeName,
|
|
201
|
+
return super.detectElementType(nodeName, /^[A-Z]|\./);
|
|
194
202
|
}
|
|
195
203
|
visitExpression(token,
|
|
196
204
|
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/svelte-parser",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Svelte parser for markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"clean": "tsc --build --clean"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@markuplint/html-parser": "4.0
|
|
27
|
+
"@markuplint/html-parser": "4.1.0",
|
|
28
28
|
"@markuplint/ml-ast": "4.0.1",
|
|
29
|
-
"@markuplint/parser-utils": "4.0
|
|
29
|
+
"@markuplint/parser-utils": "4.1.0",
|
|
30
30
|
"svelte": "^4.2.10"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "b9817c30c2df71faa866e3b3fe286afa499deede"
|
|
33
33
|
}
|