eslint-plugin-svelte3
Advanced tools
Comparing version 0.4.7 to 1.0.0
@@ -0,1 +1,5 @@ | ||
# v1.0.0 | ||
- Svelte v3 release party! | ||
# v0.4.7 | ||
@@ -2,0 +6,0 @@ |
{ | ||
"name": "eslint-plugin-svelte3", | ||
"version": "0.4.7", | ||
"version": "1.0.0", | ||
"description": "An ESLint plugin for Svelte v3 components.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -7,18 +7,19 @@ # eslint-plugin-svelte3 | ||
- Svelte compiler errors and warnings are exposed as ESLint errors and warnings | ||
- Variables referred to in your template won't be marked as unused in your scripts | ||
- References to store auto-subscriptions are considered references to the underlying variables | ||
- Messages about self-assignments are suppressed, as this is an official pattern for manually triggering reactive updates | ||
- Messages about unused labels called `$` are suppressed, as this is the syntax for reactive assignments | ||
- Svelte compiler errors and warnings are exposed as ESLint messages | ||
- Variable references in your template or in store auto-subscriptions are handled when linting for unused variables | ||
- Self-assignments are always allowed, as this is an official pattern for manually triggering reactive updates | ||
- Unused labels called `$` are always allowed, as this is the syntax for reactive assignments | ||
## Installation | ||
`npm install eslint-plugin-svelte3` | ||
Install the plugin package: | ||
The code on `master` may depend on unreleased Svelte 3 features. Tagged releases should always work with the specified Svelte version. The latest tagged version requires at least Svelte `3.0.0-beta.4`. | ||
``` | ||
npm install eslint-plugin-svelte3 | ||
``` | ||
Then add `svelte3` to the `plugins` array in your `.eslintrc.*`. | ||
## Usage | ||
Just add `svelte3` to the array of plugins in your `.eslintrc.*`. | ||
This plugin needs to be able to `require('svelte/compiler')`. If ESLint, this plugin, and Svelte are all installed locally in your project, this should not be a problem. | ||
@@ -30,3 +31,3 @@ | ||
Some settings work best with a function as their value, which is only possible using a CommonJS-formatted `.eslintrc.js` file, and not a JSON- or YAML-formatted configuration file. Using `overrides` in the configuration file for specific globs will also give you more control over the configuration. | ||
Some settings work best with a function as their value, which is only possible using a CommonJS `.eslintrc.js` file, and not a JSON or YAML configuration file. Using `overrides` in the configuration file for specific globs will also give you more control over the configuration. | ||
@@ -47,3 +48,3 @@ ### `svelte3/enabled` | ||
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. | ||
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 for some other reason need to control how the plugin compiles the components it's linting, you can use this setting. | ||
@@ -84,3 +85,3 @@ This can be an object of compiler options or a function that accepts a file path and returns an object of compiler options. | ||
Then, you'll need to tell the ESLint extension to also lint files with language `html` and to enable autofixing problems. If you haven't adjusted the `eslint.validate` setting, it defaults to `[ "javascript", "javascriptreact" ]`, so put this in your `settings.json`: | ||
Then, you'll need to tell the ESLint extension to also lint files with language `html` and to enable autofixing where possible. If you haven't adjusted the `eslint.validate` setting, it defaults to `[ "javascript", "javascriptreact" ]`, so put this in your `settings.json`: | ||
@@ -106,3 +107,3 @@ ```json | ||
Unless you're using `.html` for your Svelte components, you'll need to configure `*`.`core`.`customFileTypes` to associate the appropriate file extension with the `test.html.basic` language. For example, to associate `.svelte`, put this in your `config.cson`: | ||
Unless you're using `.html` for your Svelte components, you'll need to configure `*`.`core`.`customFileTypes` to associate the appropriate file extension with the `text.html.basic` language. For example, to associate `.svelte`, put this in your `config.cson`: | ||
@@ -109,0 +110,0 @@ ```cson |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
145
18750