-
-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
What version of ESLint are you using?
8.15.10
What version of eslint-plugin-svelte
are you using?
2.2.0
What did you do?
Configuration
"no-undef" : "error",
"svelte/valid-compile" : [ "error", {
// We do some stuff that goes against web a11y best practices, because
// we're not a website.
ignoreWarnings : true,
}],
"svelte/no-unknown-style-directive-property" : [ "warn", {
// These are special gameface-only properties, and svelte does the
// right thing with them under the covers so let 'em through
ignoreProperties : [
"/\\w+PX$/",
],
}],
"svelte/html-quotes" : [ "warn", {
prefer : "double",
}],
"svelte/max-attributes-per-line" : [ "warn", {
singleline : 3,
}],
"svelte/first-attribute-linebreak" : "warn",
"svelte/mustache-spacing" : "warn",
"svelte/prefer-style-directive" : "warn",
"svelte/no-useless-mustaches" : "warn",
"svelte/require-optimized-style-attribute" : "error",
"svelte/shorthand-attribute" : "warn",
"svelte/shorthand-directive" : "warn",
"svelte/spaced-html-comment" : "warn",
"svelte/no-inner-declarations" : "error",
// Disabled in favor of svelte-specific rule
"indent" : "off",
"svelte/indent" : [ "warn", {
indent : "tab",
indentScript : false,
}],
<script>
import { readable } from "svelte/store";
const bar = {
foo : readable("hi"),
};
$: ({ foo } = $bar);
$: baz = $foo;
</script>
{baz};
What did you expect to happen?
The destructured store is valid, and should be understood to be a reference to the non-$
prefixed variable.
What actually happened?
[13:9]: 'foo' is defined but never used. [(no-unused-vars)](https://eslint.org/docs/rules/no-unused-vars)
[15:12]: '$foo' is not defined. [(no-undef)](https://eslint.org/docs/rules/no-undef)
Link to Minimal Reproducible Example
Additional comments
Svelte REPL Repro of the code correctly subscribing to the destructured store.
Seems similar in some ways to #172 as well.
Metadata
Metadata
Assignees
Labels
No labels