eslint-plugin-svelte3
Advanced tools
Comparing version 0.4.5 to 0.4.6
@@ -0,1 +1,5 @@ | ||
# v0.4.6 | ||
- Add `svelte3/compiler-options` setting to control how the compiler is called during linting | ||
# v0.4.5 | ||
@@ -2,0 +6,0 @@ |
@@ -5,3 +5,3 @@ 'use strict'; | ||
let messages, transformed_code, ignore_warnings, module_info, instance_info; | ||
let compiler_options, messages, transformed_code, ignore_warnings, module_info, instance_info; | ||
@@ -138,3 +138,3 @@ // get the total length, number of lines, and length of the last line of a string | ||
try { | ||
result = compile(text, { generate: false }); | ||
result = compile(text, compiler_options); | ||
} catch ({ name, message, start, end }) { | ||
@@ -246,3 +246,3 @@ // convert the error to a linting message, store it, and return | ||
return typeof value === 'function' ? value : | ||
typeof value === 'boolean' ? () => value : | ||
typeof value === 'boolean' || typeof value === 'object' ? () => value : | ||
Array.isArray(value) ? Array.prototype.includes.bind(value) : | ||
@@ -275,2 +275,4 @@ v => v === value; | ||
} | ||
const compiler_options_setting = get_setting_function(config, 'svelte3/compiler-options', false); | ||
compiler_options = compiler_options_setting ? Object.assign({ generate: false }, compiler_options_setting(options.filename)) : { generate: false }; | ||
} | ||
@@ -277,0 +279,0 @@ } |
{ | ||
"name": "eslint-plugin-svelte3", | ||
"version": "0.4.5", | ||
"version": "0.4.6", | ||
"description": "An ESLint plugin for Svelte v3 components.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -43,2 +43,10 @@ # eslint-plugin-svelte3 | ||
### `svelte3/compiler-options` | ||
Most compiler options do not affect the validity of compiled components, but a couple of them can. If you are compiling to custom elements, or otherwise need to control how the plugin compiles the components it's linting, you can use this setting. | ||
This can be an object of compiler options or a function that accepts a file path and returns an object of compiler options. | ||
The default is to compile with `{ generate: false }`. | ||
### `svelte3/ignore-styles` | ||
@@ -45,0 +53,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18990
257
144