-
-
Notifications
You must be signed in to change notification settings - Fork 48
Wrong conditional checkings #254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
After remove all pretiier stuff, the issue is gone. But why you need to override "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte-eslint-parser" } }] |
This overide setting in I have removed prettier form eslint and stil have this error @baseballyama . |
DId you do the below steps?
|
@baseballyama did all of it, and the eslint still throw the warning |
Probably treated and reported the same as the following typescript-eslint DEMO. let isOpen = false;
let id: string | undefined = undefined;
;
(() => (isOpen = !isOpen));
!isOpen && id // <- reported It might be possible to solve it by creating a temporary scope in the parser and letting typescript build the type information. let isOpen = false;
let id: string | undefined = undefined;
;
function tmp () {
(() => (isOpen = !isOpen));
!isOpen && id // <- OK
} |
Hmm... I've considered it a bit, but it can be difficult. export let isOpen = false;
export let id: string | undefined = undefined;
$: a = !isOpen/*NG*/ && id |
Funny thing is, the typescript evalute |
@ota-meshi and the other funny thing is, this condition works great when You use one of the variables, |
Before You File a Bug Report Please Confirm You Have Done The Following...
What version of ESLint are you using?
8.23.1
What version of
eslint-plugin-svelte
are you using?2.8.0
What did you do?
Simple true/false check.
What did you expect to happen?
No eslitn errors.
What actually happened?
Link to Minimal Reproducible Example
https://github.com/mpiorowski/svelte-eslint-bug/blob/main/src/routes/%2Bpage.svelte
Additional comments
Thank You for fixing my previous issue, Your plugin is much better then the native svelte one :)
The text was updated successfully, but these errors were encountered: