Skip to content

client: Enable eqeqeq lint - #1617

Draft
jtojnar wants to merge 5 commits into
masterfrom
eqeqeq
Draft

client: Enable eqeqeq lint#1617
jtojnar wants to merge 5 commits into
masterfrom
eqeqeq

Conversation

@jtojnar

@jtojnar jtojnar commented Aug 23, 2026

Copy link
Copy Markdown
Member

Using weak comparison is overly confusing:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Equality_comparisons_and_sameness
https://dorey.github.io/JavaScript-Equality-Table/

Let’s switch to strict one where the value domain is clear and enforce this with an eslint rule:
https://eslint.org/docs/latest/rules/eqeqeq

In places where the correctness was not obvious, adding a suppression comment until it is cleared.

Marked as WIP since the normalization in items dao should be part of migration.

@netlify

netlify Bot commented Aug 23, 2026

Copy link
Copy Markdown

Deploy Preview for selfoss canceled.

Name Link
🔨 Latest commit 55493db
🔍 Latest deploy log https://app.netlify.com/projects/selfoss/deploys/6a9dad77b3e3a00007716988

`confirm` always returns bool.
The zero check was introduced in 9ace777.
But the property type is `string | null` on the client and my personal selfoss instance with pretty old database only seems to return valid icon file names or null.

In theory, a database could contain a literal `'0'` string but again, I have used selfoss for ages, and my database only contains `NULL`, empty string (mapped to NULL since 980882b) or a file name in the `items.icon` column.
It can be an empty sting sometimes, normalize it to `null`.

This should probably be done in migration once but we should check that we will not reintroduce it.
Using weak comparison is overly confusing:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Equality_comparisons_and_sameness
https://dorey.github.io/JavaScript-Equality-Table/

Let’s switch to strict one where the value domain is clear and enforce this with an eslint rule:
https://eslint.org/docs/latest/rules/eqeqeq

In places where the correctness was not obvious, adding a suppression comment until it is cleared.
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 this pull request may close these issues.

1 participant