Skip to content

Conversation

imnasnainaec
Copy link
Collaborator

@imnasnainaec imnasnainaec commented Jul 29, 2025

The false positives for '@typescript-eslint/no-redundant-type-constituents' appear related to the other 5 rules disabled for *.svelte files.

These 6 rules are also the source of most noise on the improve-platform-extension branch, so this pr prepares for re-enabling linting in frontend/platform.bible-extension/ on that branch.

Copy link

coderabbitai bot commented Jul 29, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

This change removes inline ESLint disable comments for the @typescript-eslint/no-redundant-type-constituents rule from numerous Svelte and TypeScript files across the frontend and viewer directories. The ESLint configuration is updated to globally disable this rule for Svelte files, eliminating the need for local disables.

Changes

Cohort / File(s) Change Summary
ESLint Configuration Update
frontend/eslint.config.js
Updated Svelte override: added '@typescript-eslint/no-redundant-type-constituents': 'off', reordered disables.
Frontend Components – Filter & Project
frontend/src/lib/components/FilterBar/FilterBar.svelte, frontend/src/lib/components/Projects/ProjectConfidentialityFilterSelect.svelte
Removed ESLint disable comments for redundant type constituents.
Frontend Modals
frontend/src/lib/components/modals/ConfirmDeleteModal.svelte, frontend/src/lib/components/modals/FormModal.svelte
Removed ESLint disables for type constituent rules from variable and function signatures.
Admin & User Account Pages
frontend/src/routes/(authenticated)/admin/+page.svelte, frontend/src/routes/(authenticated)/admin/EditUserAccount.svelte
Removed ESLint disables for redundant type constituents on query parameter and variable declarations.
Organization Modals
frontend/src/routes/(authenticated)/org/[org_id]/AddMyProjectsToOrgModal.svelte, .../AddOrgMemberModal.svelte, .../BulkAddOrgMembers.svelte, .../ChangeOrgMemberRoleModal.svelte
Removed ESLint disables for redundant type constituents on modal variable declarations.
Project Modals
frontend/src/routes/(authenticated)/project/[project_code]/AddOrganization.svelte, .../AddProjectMember.svelte, .../AddPurpose.svelte, .../BulkAddProjectMembers.svelte, .../ChangeMemberRoleModal.svelte, .../ProjectConfidentialityModal.svelte, .../ResetProjectModal.svelte
Removed ESLint disables for redundant type constituents on modal and status variables.
Viewer – Button & Field Editors
frontend/viewer/src/lib/OpenInFieldWorksButton.svelte, frontend/viewer/src/lib/components/field-editors/multi-select.svelte, frontend/viewer/src/lib/components/field-editors/select.svelte
Removed ESLint disables for redundant type constituents in props and function declarations.
Viewer – UI Icon
frontend/viewer/src/lib/components/ui/icon/pinging-icon.svelte
Removed ESLint disables for redundant type constituents in type alias.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

💻 FW Lite

Poem

A bunny hops through code so neat,
Sweeping up comments obsolete.
With rules now set in ESLint’s den,
No disables needed—just clean code again!
The garden’s free of cluttered lines,
And every Svelte file now shines.
🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch no-redundant-type-constituents

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related 📦 Lexbox issues related to any server side code, fw-headless included labels Jul 29, 2025
Copy link

github-actions bot commented Jul 29, 2025

UI unit Tests

  1 files  ±0   40 suites  ±0   21s ⏱️ ±0s
 82 tests ±0   82 ✅ ±0  0 💤 ±0  0 ❌ ±0 
116 runs  ±0  116 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit daa6ce6. ± Comparison against base commit 80be18a.

♻️ This comment has been updated with latest results.

Copy link

argos-ci bot commented Jul 29, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Awaiting the start of a new Argos build…

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
frontend/eslint.config.js (1)

41-46: Document the temporary rule disable to avoid long-term drift

Switching @typescript-eslint/no-redundant-type-constituents off for every Svelte file is a pragmatic way to silence today’s false-positives, but it also removes legitimate signal for future code.
Add a short comment (or a TODO dated ticket number) explaining why it is off and the plan for revisiting/re-enabling it once the underlying Svelte-parser issue is fixed. This prevents the rule from remaining silently disabled forever.

frontend/src/lib/components/modals/FormModal.svelte (1)

60-67: Prefer the ? optional parameter over | undefined for readability

Using the ? syntax communicates intent more clearly and drops the now-unnecessary undefined constituent the rule used to complain about.

-export async function open(
-  value: Partial<FormType> | undefined,
+export async function open(
+  value?: Partial<FormType>,
   onSubmit: SubmitCallback,
 ): Promise<FormModalResult<Schema>>;

 // implementation overload
-export async function open(
-  valueOrOnSubmit: Partial<FormType> | SubmitCallback | undefined,
+export async function open(
+  valueOrOnSubmit?: Partial<FormType> | SubmitCallback,
   _onSubmit?: SubmitCallback,

This keeps the API surface identical (open(undefined, cb) still type-checks) while making the signatures shorter and side-steps the redundant-constituent smell even with the rule disabled.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe8f970 and c5d63dc.

📒 Files selected for processing (22)
  • frontend/eslint.config.js (1 hunks)
  • frontend/src/lib/components/FilterBar/FilterBar.svelte (0 hunks)
  • frontend/src/lib/components/Projects/ProjectConfidentialityFilterSelect.svelte (0 hunks)
  • frontend/src/lib/components/modals/ConfirmDeleteModal.svelte (0 hunks)
  • frontend/src/lib/components/modals/FormModal.svelte (1 hunks)
  • frontend/src/routes/(authenticated)/admin/+page.svelte (0 hunks)
  • frontend/src/routes/(authenticated)/admin/EditUserAccount.svelte (0 hunks)
  • frontend/src/routes/(authenticated)/org/[org_id]/AddMyProjectsToOrgModal.svelte (0 hunks)
  • frontend/src/routes/(authenticated)/org/[org_id]/AddOrgMemberModal.svelte (0 hunks)
  • frontend/src/routes/(authenticated)/org/[org_id]/BulkAddOrgMembers.svelte (0 hunks)
  • frontend/src/routes/(authenticated)/org/[org_id]/ChangeOrgMemberRoleModal.svelte (0 hunks)
  • frontend/src/routes/(authenticated)/project/[project_code]/AddOrganization.svelte (0 hunks)
  • frontend/src/routes/(authenticated)/project/[project_code]/AddProjectMember.svelte (0 hunks)
  • frontend/src/routes/(authenticated)/project/[project_code]/AddPurpose.svelte (0 hunks)
  • frontend/src/routes/(authenticated)/project/[project_code]/BulkAddProjectMembers.svelte (0 hunks)
  • frontend/src/routes/(authenticated)/project/[project_code]/ChangeMemberRoleModal.svelte (0 hunks)
  • frontend/src/routes/(authenticated)/project/[project_code]/ProjectConfidentialityModal.svelte (0 hunks)
  • frontend/src/routes/(authenticated)/project/[project_code]/ResetProjectModal.svelte (0 hunks)
  • frontend/viewer/src/lib/OpenInFieldWorksButton.svelte (0 hunks)
  • frontend/viewer/src/lib/components/field-editors/multi-select.svelte (0 hunks)
  • frontend/viewer/src/lib/components/field-editors/select.svelte (0 hunks)
  • frontend/viewer/src/lib/components/ui/icon/pinging-icon.svelte (0 hunks)
💤 Files with no reviewable changes (20)
  • frontend/src/routes/(authenticated)/org/[org_id]/BulkAddOrgMembers.svelte
  • frontend/src/routes/(authenticated)/org/[org_id]/AddMyProjectsToOrgModal.svelte
  • frontend/viewer/src/lib/components/ui/icon/pinging-icon.svelte
  • frontend/src/routes/(authenticated)/project/[project_code]/AddProjectMember.svelte
  • frontend/src/routes/(authenticated)/project/[project_code]/AddPurpose.svelte
  • frontend/src/routes/(authenticated)/admin/EditUserAccount.svelte
  • frontend/src/routes/(authenticated)/project/[project_code]/ProjectConfidentialityModal.svelte
  • frontend/src/routes/(authenticated)/org/[org_id]/ChangeOrgMemberRoleModal.svelte
  • frontend/src/lib/components/FilterBar/FilterBar.svelte
  • frontend/viewer/src/lib/components/field-editors/select.svelte
  • frontend/viewer/src/lib/OpenInFieldWorksButton.svelte
  • frontend/src/routes/(authenticated)/project/[project_code]/ResetProjectModal.svelte
  • frontend/src/routes/(authenticated)/org/[org_id]/AddOrgMemberModal.svelte
  • frontend/src/routes/(authenticated)/project/[project_code]/ChangeMemberRoleModal.svelte
  • frontend/src/lib/components/modals/ConfirmDeleteModal.svelte
  • frontend/src/lib/components/Projects/ProjectConfidentialityFilterSelect.svelte
  • frontend/src/routes/(authenticated)/admin/+page.svelte
  • frontend/src/routes/(authenticated)/project/[project_code]/BulkAddProjectMembers.svelte
  • frontend/viewer/src/lib/components/field-editors/multi-select.svelte
  • frontend/src/routes/(authenticated)/project/[project_code]/AddOrganization.svelte
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: rmunn
PR: sillsdev/languageforge-lexbox#1836
File: frontend/viewer/src/lib/components/audio/AudioDialog.svelte:25-25
Timestamp: 2025-07-22T09:19:37.386Z
Learning: In the sillsdev/languageforge-lexbox project, when file size limits or other constants need to be shared between C# backend and TypeScript frontend code, prefer exposing them through Reinforced.Typings type generation rather than hardcoding the values separately. This ensures consistency and prevents discrepancies when values change.
frontend/eslint.config.js (1)

Learnt from: rmunn
PR: #1836
File: frontend/viewer/src/lib/components/audio/AudioDialog.svelte:25-25
Timestamp: 2025-07-22T09:19:37.386Z
Learning: In the sillsdev/languageforge-lexbox project, when file size limits or other constants need to be shared between C# backend and TypeScript frontend code, prefer exposing them through Reinforced.Typings type generation rather than hardcoding the values separately. This ensures consistency and prevents discrepancies when values change.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Build UI / publish-ui
  • GitHub Check: Build API / publish-api
  • GitHub Check: check-and-lint
  • GitHub Check: frontend-component-unit-tests
  • GitHub Check: frontend
  • GitHub Check: Analyze (csharp)
  • GitHub Check: Build FW Lite and run tests

Copy link

github-actions bot commented Jul 29, 2025

C# Unit Tests

126 tests  ±0   126 ✅ ±0   12s ⏱️ ±0s
 20 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit daa6ce6. ± Comparison against base commit 80be18a.

♻️ This comment has been updated with latest results.

@imnasnainaec imnasnainaec force-pushed the no-redundant-type-constituents branch from c5d63dc to f3a6542 Compare July 29, 2025 20:37
@hahn-kev
Copy link
Collaborator

I'd like to put this on hold as I don't actually want to share linting rules between the extension and the rest of our code. See #1831 (comment)

@hahn-kev hahn-kev marked this pull request as draft July 30, 2025 02:53
@imnasnainaec
Copy link
Collaborator Author

I'd like to put this on hold as I don't actually want to share linting rules between the extension and the rest of our code. See #1831 (comment)

@hahn-kev That's a good "want", which I'm working on separately. I thought this pr might have its own merits independent of the extension. You are welcome to merge it or close it as you will.

@hahn-kev
Copy link
Collaborator

@myieye and @rmunn what do you think about just disabling this rule? Here's the docs https://typescript-eslint.io/rules/no-redundant-type-constituents/

@hahn-kev hahn-kev requested a review from rmunn August 4, 2025 08:16
@hahn-kev
Copy link
Collaborator

hahn-kev commented Aug 4, 2025

In our team meeting we would like to keep this lint rule, the places where it was disabled previously were false positives (per Tim), so it's worth checking if that's still the case then we can remove the comments disabling the rule.

@myieye
Copy link
Collaborator

myieye commented Aug 4, 2025

To complete what @hahn-kev said, I think we're probably ok with this PR, if after the es-lint updates/package bumps @rmunn recently made, svelte files are still riddled with these false positives. At least I'm pretty sure they're false positives. It does seem weird that Svelte tooling would still be struggling with these.

@imnasnainaec imnasnainaec force-pushed the no-redundant-type-constituents branch from f3a6542 to 8e83297 Compare August 4, 2025 12:47
@imnasnainaec imnasnainaec marked this pull request as ready for review August 4, 2025 12:47
@imnasnainaec
Copy link
Collaborator Author

To complete what @hahn-kev said, I think we're probably ok with this PR, if after the es-lint updates/package bumps @rmunn recently made, svelte files are still riddled with these false positives. At least I'm pretty sure they're false positives. It does seem weird that Svelte tooling would still be struggling with these.

@myieye Yes, they're all still getting hit and they look like false positives to me.

Copy link
Collaborator

@myieye myieye left a comment

Choose a reason for hiding this comment

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

I did some fiddling and found that some of the rule violations could be avoided, but there were still many I had no idea what to do with. So, all-in-all, I'm in favor of this PR.

@imnasnainaec imnasnainaec merged commit 8133bd2 into develop Aug 4, 2025
27 checks passed
@imnasnainaec imnasnainaec deleted the no-redundant-type-constituents branch August 4, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related 📦 Lexbox issues related to any server side code, fw-headless included

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants