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 2.7.0 to 2.7.1

5

CHANGELOG.md

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

# 2.7.1
- Named code blocks were in fact a breaking change, sorry!
- They're now disabled by default, but can be enabled with `svelte3/named-blocks`
# 2.7.0

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

5

index.js

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

const new_block = () => ({ transformed_code: '', line_offsets: null, translations: new Map() });
let custom_compiler, default_compiler, compiler_options, messages, ignore_warnings, ignore_styles, var_names;
let custom_compiler, default_compiler, compiler_options, messages, ignore_warnings, ignore_styles, named_blocks, var_names;

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

// return processed string
return [...blocks].map(([filename, { transformed_code: text }]) => ({ text, filename }));
return [...blocks].map(([filename, { transformed_code: text }]) => named_blocks ? { text, filename } : text);
};

@@ -372,2 +372,3 @@

compiler_options = settings['svelte3/compiler-options'];
named_blocks = settings['svelte3/named-blocks'];
// call original Linter#verify

@@ -374,0 +375,0 @@ return verify.call(this, code, config, options);

2

package.json
{
"name": "eslint-plugin-svelte3",
"version": "2.7.0",
"version": "2.7.1",
"description": "An ESLint plugin for Svelte v3 components.",

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

@@ -91,2 +91,10 @@ # eslint-plugin-svelte3

### `svelte3/named-blocks`
When an [ESLint processor](https://eslint.org/docs/user-guide/configuring#specifying-processor) processes a file, it is able to output named code blocks, which can each have their own linting configuration. When this setting is enabled, the code extracted from `<script context='module>` tag, the `<script>` tag, and the template are respectively given the block names `module.js`, `instance.js`, and `template.js`.
This means that to override linting rules in Svelte components, you'd instead have to target `**/*.svelte/*.js`. But it also means that you can define an override targeting `**/*.svelte/*_template.js` for example, and that configuration will only apply to linting done on the templates in Svelte components.
The default is to not use named code blocks.
### `svelte3/compiler`

@@ -100,6 +108,2 @@

## Named code blocks
When an [ESLint processor](https://eslint.org/docs/user-guide/configuring#specifying-processor) processes a file, it is able to output named code blocks, which can each have their own linting configuration. In this plugin, the code extracted from `<script context='module>` tag, the `<script>` tag, and the template are respectively given the block names `module.js`, `instance.js`, and `template.js`. This means that you can define an override targeting `**/*.svelte/*_template.js` for example, and that configuration will only apply to linting done on the templates in Svelte components.
## Using the CLI

@@ -106,0 +110,0 @@

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