Socket
Socket
Sign inDemoInstall

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 2.3.0 to 2.4.0

5

CHANGELOG.md

@@ -0,1 +1,6 @@

# 2.4.0
- Respect `no-self-assign` rule unless self-assignment is to a top-level variable known to the compiler
- Better handling of identifiers containing unicode characters
# 2.3.0

@@ -2,0 +7,0 @@

9

index.js

@@ -5,3 +5,3 @@ 'use strict';

const SCRIPT = 1, TEMPLATE_QUOTED = 2, TEMPLATE_UNQUOTED = 3;
let compiler_options, messages, transformed_code, line_offsets, ignore_warnings, ignore_styles, translations;
let compiler_options, messages, transformed_code, line_offsets, ignore_warnings, ignore_styles, translations, var_names;

@@ -181,2 +181,3 @@ // get the total length, number of lines, and length of the last line of a string

const { ast, warnings, vars } = result;
var_names = new Set(vars.map(v => v.name));
const injected_vars = vars.filter(v => v.injected);

@@ -295,4 +296,4 @@ const referenced_vars = vars.filter(v => v.referenced);

// extract something that looks like an identifier (minus insane unicode stuff) from the beginning of a string
const get_identifier = str => (str && str.match(/^[a-zA-Z_$][0-9a-zA-Z_$]*/) || [])[0];
// extract something that looks like an identifier (minus unicode escape stuff) from the beginning of a string
const get_identifier = str => (str && str.match(/^[^\s!"#%&\\'()*+,\-./:;<=>?@[\\\]^`{|}~]+/) || [])[0];

@@ -306,3 +307,3 @@ // determine whether this message from ESLint is something we care about

case 'no-restricted-syntax': return message.nodeType !== 'LabeledStatement' || get_identifier(get_referenced_string(message)) !== '$';
case 'no-self-assign': return false;
case 'no-self-assign': return !var_names.has(get_identifier(get_referenced_string(message)));
case 'no-unused-labels': return get_referenced_string(message) !== '$';

@@ -309,0 +310,0 @@ case 'quotes': return type !== TEMPLATE_QUOTED;

{
"name": "eslint-plugin-svelte3",
"version": "2.3.0",
"version": "2.4.0",
"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