Skip to content

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

Closed
2 tasks done
mpiorowski opened this issue Sep 14, 2022 · 8 comments · Fixed by #262
Closed
2 tasks done

Wrong conditional checkings #254

mpiorowski opened this issue Sep 14, 2022 · 8 comments · Fixed by #262

Comments

@mpiorowski
Copy link

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.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?

image

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 :)

@baseballyama
Copy link
Member

After remove all pretiier stuff, the issue is gone.
So this is not this ESLint plugin's issue.

But why you need to override parser in .prettierrc?

"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte-eslint-parser" } }]

@mpiorowski
Copy link
Author

mpiorowski commented Sep 14, 2022

This overide setting in .prettierrc was the default one when i create new sveltekit project ;p Didn't even notice. Removed it already.

I have removed prettier form eslint and stil have this error @baseballyama .
What excatly did You deleted to make it not throw error?

@baseballyama
Copy link
Member

baseballyama commented Sep 15, 2022

DId you do the below steps?

  1. run npm rm eslint-config-prettier eslint-plugin-prettier prettier prettier-plugin-svelte
  2. run rm -rf ./node_modules
  3. run npm i
  4. restart your IDE

@mpiorowski
Copy link
Author

@baseballyama did all of it, and the eslint still throw the warning

@ota-meshi
Copy link
Member

@mpiorowski
Copy link
Author

Funny thing is, the typescript evalute isOpen variable correctly as boolean, not true / false, and still eslint throws warning ;p

@mpiorowski
Copy link
Author

@ota-meshi and the other funny thing is, this condition works great when You use one of the variables, isOpen or id :D No warning then (logically it should also throw warning). BUT when You add the "&&" then the magic starts happening :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants