Socket
Socket
Sign inDemoInstall

svelte-eslint-parser

Package Overview
Dependencies
Maintainers
4
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-eslint-parser - npm Package Compare versions

Comparing version 0.32.0 to 0.32.1

2

lib/meta.d.ts
export declare const name: "svelte-eslint-parser";
export declare const version: "0.32.0";
export declare const version: "0.32.1";

@@ -8,2 +8,2 @@ "use strict";

exports.name = "svelte-eslint-parser";
exports.version = "0.32.0";
exports.version = "0.32.1";

@@ -169,3 +169,5 @@ "use strict";

const idAwaitThenValue = typeCtx.generateUniqueId("AwaitThenValue");
if (node.expression.type === "Identifier") {
if (node.expression.type === "Identifier" &&
// We cannot use type annotations like `(x: Foo<x>)` if they have the same identifier name.
!hasIdentifierFor(node.expression.name, baseParam.node)) {
return {

@@ -287,1 +289,22 @@ preparationScript: [generateAwaitThenValueType(idAwaitThenValue)],

}
/** Checks whether the given name identifier is exists or not. */
function hasIdentifierFor(name, node) {
if (node.type === "Identifier") {
return node.name === name;
}
if (node.type === "ObjectPattern") {
return node.properties.some((property) => property.type === "Property"
? hasIdentifierFor(name, property.value)
: hasIdentifierFor(name, property));
}
if (node.type === "ArrayPattern") {
return node.elements.some((element) => element && hasIdentifierFor(name, element));
}
if (node.type === "RestElement") {
return hasIdentifierFor(name, node.argument);
}
if (node.type === "AssignmentPattern") {
return hasIdentifierFor(name, node.left);
}
return false;
}
{
"name": "svelte-eslint-parser",
"version": "0.32.0",
"version": "0.32.1",
"description": "Svelte parser for ESLint",

@@ -13,3 +13,3 @@ "repository": "git+https://github.com/sveltejs/svelte-eslint-parser.git",

"license": "MIT",
"packageManager": "pnpm@7.33.2",
"packageManager": "pnpm@7.33.3",
"engines": {

@@ -40,3 +40,3 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"

"espree": "^9.0.0",
"postcss": "^8.4.23",
"postcss": "^8.4.25",
"postcss-scss": "^4.0.6"

@@ -59,3 +59,3 @@ },

"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "~5.60.0",
"@typescript-eslint/parser": "~5.61.0",
"@typescript-eslint/types": "^5.59.9",

@@ -85,3 +85,3 @@ "benchmark": "^2.1.4",

"prettier": "^2.8.8",
"prettier-plugin-pkg": "^0.17.1",
"prettier-plugin-pkg": "^0.18.0",
"prettier-plugin-svelte": "^2.10.1",

@@ -88,0 +88,0 @@ "rimraf": "^5.0.1",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc