Skip to content

Comments

Suppress false positive lint warning in LanguageModal#208

Open
El-Magico777 wants to merge 1 commit intov0.2.3from
mute-lint-languagemodel-magic
Open

Suppress false positive lint warning in LanguageModal#208
El-Magico777 wants to merge 1 commit intov0.2.3from
mute-lint-languagemodel-magic

Conversation

@El-Magico777
Copy link
Collaborator

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-coalescing rule. This was introduced in PR #202

Issue

The ESLint rule @typescript-eslint/prefer-nullish-coalescing was 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-disable and eslint-enable comments 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 statement

Technical 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 return true if any condition is met, not for default value assignment where ?? would be appropriate.

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory
  • I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced
  • I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors

Please put your Discord username so you can be contacted if a bug or regression is found:

el_magico777

@El-Magico777 El-Magico777 added this to the v0.2.3 milestone Feb 6, 2026
@El-Magico777 El-Magico777 self-assigned this Feb 6, 2026
@El-Magico777 El-Magico777 added the bug Something isn't working label Feb 6, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@El-Magico777 El-Magico777 force-pushed the mute-lint-languagemodel-magic branch from 3fa4282 to e3ba6b7 Compare February 6, 2026 19:32
@El-Magico777 El-Magico777 marked this pull request as ready for review February 6, 2026 19:34
@El-Magico777 El-Magico777 modified the milestones: v0.2.3, v0.3.0 Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants