svelte-eslint-parser
Advanced tools
+1
-1
| export declare const name = "svelte-eslint-parser"; | ||
| export declare const version = "0.40.0"; | ||
| export declare const version = "0.41.0"; |
+1
-1
@@ -8,2 +8,2 @@ "use strict"; | ||
| exports.name = "svelte-eslint-parser"; | ||
| exports.version = "0.40.0"; | ||
| exports.version = "0.41.0"; |
@@ -80,8 +80,4 @@ "use strict"; | ||
| const value = node.value; | ||
| const shorthand = value.find((v) => v.type === "AttributeShorthand") || | ||
| // for Svelte v5 | ||
| (value.length === 1 && | ||
| value[0].type === "ExpressionTag" && | ||
| ctx.code[node.start] === "{" && | ||
| ctx.code[node.end - 1] === "}"); | ||
| const shorthand = isAttributeShorthandForSvelteV4(value) || | ||
| isAttributeShorthandForSvelteV5(value); | ||
| if (shorthand) { | ||
@@ -111,8 +107,18 @@ const key = Object.assign(Object.assign({}, attribute.key), { type: "Identifier" }); | ||
| ctx.addToken("HTMLIdentifier", keyRange); | ||
| processAttributeValue(node.value, attribute, parent, ctx); | ||
| processAttributeValue(value, attribute, parent, ctx); | ||
| return attribute; | ||
| function isAttributeShorthandForSvelteV4(value) { | ||
| var _a; | ||
| return Array.isArray(value) && ((_a = value[0]) === null || _a === void 0 ? void 0 : _a.type) === "AttributeShorthand"; | ||
| } | ||
| function isAttributeShorthandForSvelteV5(value) { | ||
| return (!Array.isArray(value) && | ||
| value.type === "ExpressionTag" && | ||
| ctx.code[node.start] === "{" && | ||
| ctx.code[node.end - 1] === "}"); | ||
| } | ||
| } | ||
| /** Common process attribute value */ | ||
| function processAttributeValue(nodeValue, attribute, attributeParent, ctx) { | ||
| const nodes = nodeValue | ||
| const nodes = (Array.isArray(nodeValue) ? nodeValue : [nodeValue]) | ||
| .filter((v) => v.type !== "Text" || | ||
@@ -119,0 +125,0 @@ // ignore empty |
@@ -171,3 +171,3 @@ import type ESTree from "estree"; | ||
| name: string; | ||
| value: (Text | AttributeShorthand | MustacheTag)[] | true; | ||
| value: (Text | MustacheTag)[] | [AttributeShorthand] | true; | ||
| } | ||
@@ -174,0 +174,0 @@ export interface Spread extends BaseNode { |
+13
-13
| { | ||
| "name": "svelte-eslint-parser", | ||
| "version": "0.40.0", | ||
| "version": "0.41.0", | ||
| "description": "Svelte parser for ESLint", | ||
@@ -29,3 +29,3 @@ "repository": "git+https://github.com/sveltejs/svelte-eslint-parser.git", | ||
| "peerDependencies": { | ||
| "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0-next.181" | ||
| "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0-next.191" | ||
| }, | ||
@@ -56,7 +56,7 @@ "peerDependenciesMeta": { | ||
| "@types/mocha": "^10.0.7", | ||
| "@types/node": "^20.14.10", | ||
| "@types/node": "^20.14.11", | ||
| "@types/semver": "^7.5.8", | ||
| "@typescript-eslint/eslint-plugin": "^7.16.0", | ||
| "@typescript-eslint/parser": "~7.16.0", | ||
| "@typescript-eslint/types": "~7.16.0", | ||
| "@typescript-eslint/eslint-plugin": "^7.16.1", | ||
| "@typescript-eslint/parser": "~7.16.1", | ||
| "@typescript-eslint/types": "~7.16.1", | ||
| "benchmark": "^2.1.4", | ||
@@ -74,5 +74,5 @@ "chai": "^4.4.1", | ||
| "eslint-plugin-node-dependencies": "^0.12.0", | ||
| "eslint-plugin-prettier": "^5.1.3", | ||
| "eslint-plugin-prettier": "^5.2.1", | ||
| "eslint-plugin-regexp": "^2.6.0", | ||
| "eslint-plugin-svelte": "^2.41.0", | ||
| "eslint-plugin-svelte": "^2.42.0", | ||
| "eslint-plugin-yml": "^1.14.0", | ||
@@ -85,8 +85,8 @@ "estree-walker": "^3.0.3", | ||
| "nyc": "^17.0.0", | ||
| "prettier": "~3.3.2", | ||
| "prettier": "~3.3.3", | ||
| "prettier-plugin-pkg": "^0.18.1", | ||
| "prettier-plugin-svelte": "^3.2.5", | ||
| "rimraf": "^6.0.0", | ||
| "semver": "^7.6.2", | ||
| "svelte": "^5.0.0-next.181", | ||
| "prettier-plugin-svelte": "^3.2.6", | ||
| "rimraf": "^6.0.1", | ||
| "semver": "^7.6.3", | ||
| "svelte": "^5.0.0-next.191", | ||
| "svelte2tsx": "^0.7.13", | ||
@@ -93,0 +93,0 @@ "typescript": "~5.5.3", |
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
347984
0.09%8364
0.07%