Suppress false positive lint warning in LanguageModal#208
Open
El-Magico777 wants to merge 1 commit intov0.2.3from
Open
Suppress false positive lint warning in LanguageModal#208El-Magico777 wants to merge 1 commit intov0.2.3from
El-Magico777 wants to merge 1 commit intov0.2.3from
Conversation
6ae6506 to
e3ba6b7
Compare
There was a problem hiding this comment.
Pull request overview
Suppresses an ESLint false-positive in the client language search filter logic (LanguageModal) where boolean || conditions are incorrectly flagged by @typescript-eslint/prefer-nullish-coalescing.
Changes:
- Adds a targeted ESLint suppression around the language filter boolean OR expression in
LanguageModal.
3fa4282 to
e3ba6b7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR suppresses a false positive ESLint warning in the language filter logic where boolean OR operators are being incorrectly flagged by the
@typescript-eslint/prefer-nullish-coalescingrule. This was introduced in PR #202Issue
The ESLint rule
@typescript-eslint/prefer-nullish-coalescingwas incorrectly warning about the use of||operators in the language filter's boolean logic. These operators are used correctly for boolean OR operations (checking if search text matches any of three fields), not for nullish coalescing.Solution
Added targeted
eslint-disableandeslint-enablecomments around the specific filter logic block to suppress the false positive warnings while keeping the rule active for the rest of the file.Files Changed
src/client/LanguageModal.ts- Added ESLint disable/enable comments around the filter return statementTechnical Details
The filter checks if a search query matches any of three language properties:
lang.native.toLowerCase().includes(search)lang.en.toLowerCase().includes(search)lang.code.toLowerCase().includes(search)Using
||is correct here as we want to returntrueif any condition is met, not for default value assignment where??would be appropriate.Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
el_magico777