Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svelte-eslint-parser

Package Overview
Dependencies
Maintainers
1
Versions
113
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.4.4 to 0.4.5

2

lib/context/index.d.ts

@@ -10,3 +10,3 @@ import type { Comment, Locations, Token } from "../ast";

private _appendScriptLets;
separateSemiIndex: number;
separateIndexes: number[];
constructor(script: string, attrs: Record<string, string | undefined>);

@@ -13,0 +13,0 @@ get vcode(): string;

@@ -15,6 +15,7 @@ "use strict";

this._appendScriptLets = null;
this.separateIndexes = [];
this.raw = script;
this.trimmedRaw = script.trimEnd();
this.attrs = attrs;
this.separateSemiIndex = script.length;
this.separateIndexes = [script.length];
}

@@ -30,4 +31,4 @@ get vcode() {

this._appendScriptLets = "";
this.separateSemiIndex = this.vcode.length;
this._appendScriptLets += ";";
this.separateIndexes = [this.vcode.length, this.vcode.length + 1];
this._appendScriptLets += "\n;";
const after = this.raw.slice(this.vcode.length);

@@ -34,0 +35,0 @@ this._appendScriptLets += after;

@@ -289,3 +289,3 @@ "use strict";

}
const separateSemiIndex = this.script.separateSemiIndex;
const separateIndexes = this.script.separateIndexes;
const tokens = result.ast.tokens;

@@ -298,3 +298,3 @@ const processedTokens = [];

while ((tok = tokens.shift())) {
if (separateSemiIndex === tok.range[0] && tok.value === ";") {
if (separateIndexes.includes(tok.range[0]) && tok.value === ";") {
break;

@@ -320,9 +320,12 @@ }

enterNode: (node) => {
var _a;
if (((_a = node.range) === null || _a === void 0 ? void 0 : _a[1]) === separateSemiIndex + 1) {
while (node.range &&
separateIndexes.includes(node.range[1] - 1)) {
node.range[1]--;
node.loc.end.column--;
}
if (node.loc.end.column < 0) {
node.loc.end = this.ctx.getLocFromIndex(node.range[1]);
}
if (node.parent === result.ast &&
separateSemiIndex <= node.range[0]) {
separateIndexes[0] <= node.range[0]) {
removeStatements.push(node);

@@ -329,0 +332,0 @@ }

{
"name": "svelte-eslint-parser",
"version": "0.4.4",
"version": "0.4.5",
"description": "Svelte parser for ESLint",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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