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

eslint-plugin-svelte3

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-svelte3 - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

4

CHANGELOG.md

@@ -0,1 +1,5 @@

# v1.2.1
- Avoid mutating the AST while linting, which can have adverse effects
# v1.2.0

@@ -2,0 +6,0 @@

19

index.js

@@ -6,2 +6,3 @@ 'use strict';

let compiler_options, messages, transformed_code, ignore_warnings, lint_template, translations;
const skipping = new WeakSet();

@@ -215,11 +216,17 @@ // get the total length, number of lines, and length of the last line of a string

enter(node) {
if (skipping.has(node)) {
this.skip();
}
if (node.context && typeof node.context === 'object') {
// find all the variables declared in this context (potentially involving spreads)
// find all the variables declared in this context
const names = [];
walk(node.context, {
enter(node) {
if (node.name) {
// When traversing the context, we want to skip over all `key` children
// But if the context involves destructuring like { foo }, we have a node with `node.key === node.value`
// This prevents us from being able to tell whether we got here via the parent's `key` or `value`
// So we first detangle the shared references by stringifying and parsing
walk(JSON.parse(JSON.stringify(node.context)), {
enter(node, parent) {
if (node.name && !(parent && parent.key === node)) {
names.push(node.name);
}
delete node.key;
},

@@ -237,3 +244,3 @@ });

transformed_code += ';\n';
delete node.expression;
skipping.add(node.expression);
}

@@ -240,0 +247,0 @@ },

{
"name": "eslint-plugin-svelte3",
"version": "1.2.0",
"version": "1.2.1",
"description": "An ESLint plugin for Svelte v3 components.",

@@ -5,0 +5,0 @@ "keywords": [

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