Skip to content

Conversation

@judah-sotomayor
Copy link
Contributor

@judah-sotomayor judah-sotomayor commented Jul 10, 2025

Reconfigure ESLint to work well with prettier

Per #864.
This pull-request includes several related changes:

  1. Reconfigure ESLint using a modern configuration and good rules for svelte.
    These rules include svelte and typescript extensions,
    as well as an integration to disable rules that conflict with prettier.
    All configuration is now consolidated in eslint.config.js, eliminating .eslintrc.cjs.
  2. Disable noisy rules. A number of rules are loud/unnecessary.
    I've turned off no-dupe-style-properties, require-each-key, and no-unused-svelte-ignore because they are spurious for our codebase.
    I've also disabled the typescript no-require-imports for the tailwind configuration file, which uses require style imports.
  3. Correct low-level eslint warnings.
    While I haven't fixed some of the more in-depth issues, every trivial issue should be corrected in this series of commits.
    This includes a number of empty objects, missing blocks around case statements, and a hundred or so conversions from var and let to const.
    As best as I can tell no behavior changes were introduced here.
    I am a bit unsure about 8a67ec3, which changes the types on the CatalogData interface to object from the empty-object type. This could cause an issue if empty-object behavior was intended, but that seems unlikely.

As it stands, the linting tests will fail because of seven unresolved errors.
Each of these is more in-depth than I want to do in a short commit, and will receive a separate PR after some discussion about the best way to resolve them.

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes

    • Corrected a typo in the inline style for font display in the font list.
    • Fixed test assertions to properly invoke matcher functions, ensuring accurate test validations.
    • Improved property existence checks for safer object handling in theme and store utilities.
  • Style

    • Standardized variable declarations to use const and let appropriately across many files for improved immutability and clarity.
    • Added curly braces to case blocks in switch statements and single-line conditionals for consistent block scoping and style.
    • Updated inline style and prop value syntax for consistency and correctness.
  • Refactor

    • Broadened type annotations for catalog data to increase flexibility.
    • Updated parameter types in analytics logging for consistency.
    • Enhanced ESLint configuration structure and updated related dependencies.
  • Chores

    • Upgraded and added several dependencies, including ESLint, TypeScript, and Svelte-related packages.
    • Removed obsolete ESLint configuration file and replaced it with a modernized config.
  • Tests

    • Improved test assertions for clarity and correctness.
    • Strengthened validation logic in test cases for book chapters.
  • Documentation

    • Added clarifying comments for error handling and lint rule suppression.

Add a proper eslint configuration using extensions for svelte,
typescript, and prettier.

This should ensure eslint does not mess with prettier's settings while
still enabling high-quality linting.

Remove the outdated .eslintrc.cjs in favor of eslint.config.js.
Mainly converting let to const, and var to let.
This change corrects video/index.ts to comply with
`no-case-declarations`.
`getEmbeddedVideoUrl` was using `let` and `const` declarations inside
cases without an appropriate block scope on each case.
As a result of this sloppiness, reused variable names were falling
through suspiciously.

This change adds a block scope to each case, and makes any local
`pattern` and `match` variables const.
Satisfy eslint by breaking up the expect on bkk.chapters in
convert/tests/sab/convertConfigSAB.test.ts to a separate 0-check and undefined-check.
Jest also notes that using toBeDefined() is better than a raw undefined
check.

https://jestjs.io/docs/expect#tobedefined
Tell eslint to ignore the require import rule for tailwind's
configuration.
Require seems to be a standard import mechanism for tailwind:  https://v2.tailwindcss.com/docs/configuration#plugins
Function wasn't being called, lol.
`dab-search-worker.ts`'s `searchDictionary()` did not assign to
`results` after it was set. Declare `results` as `const`.
Instead of calling hasOwnProperty off of an object directly, use
`Object.property` to make the call.
This avoids potential subtle problems, explained in this link:
https://eslint.org/docs/latest/rules/no-prototype-builtins#rule-details
Doesn't like empty blocks, as they may be confusing.
Replace empty object types (`{}`) with `object`.
This prevents random values from being inserted into the interface.

Could be a BREAKING CHANGE!
Other OS's had blocks, not sure why MacOS missed out.
BottomNavigationBar's `handleclick()` used a `let` binding inside a
case. Refactor to add a block around the case.
Sidebar was using a bash-style `and` shortcut instead of a proper `if`.
Fix it.
Move to a newer version of eslint-plugin-svelte in order to take
advantage of better rules and a better config syntax.

Disable `svelte/no-dupe-style-properties` as it is very noisy.
Don't warn about missing keys in each-blocks.
Remove brackets surrounding literal values.
This rule triggers a warning on statements that eslint does not use, but
the svelte LSP does use.
Several `goto` statements are used without reference to `{base}` because
they use a parameter instead of a literal url.
Silence `eslint` warnings on those in particular.
A link element attempted to set the font-family style attribute, but
misspelled it as "font-famly".

Correct spelling.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 10, 2025

Walkthrough

This update applies a series of code quality improvements and dependency updates across the project. It refactors variable declarations for immutability, clarifies test assertions, enhances ESLint configuration, updates type annotations, and corrects minor typos and style bindings. Several dependencies are upgraded, and ESLint configuration files are restructured. Additionally, many single-line conditional statements are expanded into block statements with braces for clarity and consistency.

Changes

File(s) Change Summary
.eslintrc.cjs, eslint.config.js Removed legacy ESLint config; replaced with modular, plugin-based config using ts.config() and overrides.
package.json Updated and added dependencies; removed eslint-plugin-prettier; upgraded Svelte, ESLint, and plugins.
convert/convertBooks.ts, convert/convertConfig.ts, convert/convertReverseIndex.ts,
src/lib/data/annotation-share.ts, src/lib/data/audio.ts, src/lib/data/history.ts,
src/lib/data/language.ts, src/lib/data/mrucache.ts, src/lib/data/navigation.test.ts,
src/lib/search-worker/dab-search-worker.ts, src/routes/lexicon/+page.ts
Changed let/var to const for variables that are not reassigned; removed unused variables.
src/lib/data/highlights.ts Changed var to let in loop variables for block scoping.
src/lib/data/catalogData.ts Broadened type annotations from {} to object/object[] for certain interface properties.
src/lib/data/analytics.ts Updated function parameter types from String to string.
src/lib/data/scripture.js Added comment to clarify ignored errors in a catch block.
src/lib/data/stores/store-types.js, src/lib/data/stores/theme.js Replaced direct hasOwnProperty calls with Object.prototype.hasOwnProperty.call for safety.
src/lib/search/data/test/search-config-repository-impl.test.ts,
src/lib/utils/worker-messenger/messenger.test.ts,
convert/tests/sab/convertConfigSAB.test.ts
Fixed test assertions by invoking matcher functions properly and clarifying checks.
src/app.d.ts Removed ESLint disable comment for unused vars.
src/lib/components/BottomNavigationBar.svelte, src/lib/components/Sidebar.svelte,
src/lib/components/HistoryCard.svelte, src/lib/navigate/index.ts,
src/routes/contents/[id]/+page.svelte
Added braces to case blocks; added ESLint disable comments for navigation warnings.
src/lib/components/FontList.svelte Fixed typo in style attribute (font-famlyfont-family).
src/lib/components/TextSelectionToolbar.svelte, src/routes/text/+page.svelte Changed style and prop bindings from expressions to direct string literals.
src/lib/video/index.ts, example/index.ts Added braces to switch-case blocks and changed let to const in cases for scoping and clarity.
Multiple source files (e.g., convert/convertAbout.ts, convert/convertBadges.ts,
convert/convertContents.ts, convert/convertFirebase.ts, convert/convertManifest.ts,
convert/convertMedia.ts, convert/convertSQLite.ts, convert/convertStyles.ts, convert/index.ts,
src/lib/components/AudioBar.svelte, src/lib/components/HorizontalPanes.svelte,
src/lib/components/LexiconEntryView.svelte, src/lib/components/ScriptureViewSofria.svelte,
src/lib/components/SearchForm.svelte, src/lib/components/TabsMenu.svelte, src/lib/components/VerticalPanes.svelte,
src/lib/data/stores/collection.ts, src/lib/data/stores/scripture.js, src/lib/scripts/query.js,
src/lib/scripts/render.js, src/lib/search-worker/data/pk-verse-provider.ts,
src/lib/search-worker/data/repositories/pk-search-repository-impl.ts, src/lib/search/domain/search-query-manager-impl.ts,
src/lib/search-worker/domain/test/search-session-internal.test.ts, src/routes/plans/[id]/+page.svelte,
src/routes/quiz/[collection]/[id]/+page.svelte, src/routes/search/[collection]/[[savedResults]]/+page.ts,
src/service-worker.js)
Expanded single-line conditional statements into block statements with braces for clarity and consistency; no logic changes.
src/lib/components/HtmlBookView.svelte, src/lib/components/StackView.svelte Added ESLint disable comments for svelte/no-at-html-tags around raw HTML injection.
src/routes/about/+page.svelte Added comments and ESLint disable for raw HTML injection with {@html} directive.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant ESLint
    participant Svelte
    participant TypeScript

    Developer->>ESLint: Runs lint with new config
    ESLint->>TypeScript: Uses parser and rules for TS files
    ESLint->>Svelte: Uses Svelte plugin for .svelte files
    ESLint->>ESLint: Applies Prettier and custom rule overrides
    ESLint-->>Developer: Reports lint results
Loading

Estimated code review effort

2 (~15 minutes)

Poem

In the code garden, carrots in neat rows,
The rabbit hops where clean code grows.
Const over let, and typos made right,
Linting is sharper, our future is bright!
With every small fix, the project takes flight—
🐇✨ Hopping toward clarity, day and night!

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-07-22T17_46_37_706Z-debug-0.log


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cdce158 and 4c69395.

📒 Files selected for processing (7)
  • src/lib/components/HtmlBookView.svelte (1 hunks)
  • src/lib/components/LexiconEntryView.svelte (3 hunks)
  • src/lib/components/ScriptureViewSofria.svelte (2 hunks)
  • src/lib/components/StackView.svelte (1 hunks)
  • src/lib/components/TextSelectionToolbar.svelte (2 hunks)
  • src/lib/data/stores/scripture.js (2 hunks)
  • src/routes/about/+page.svelte (1 hunks)
🧠 Learnings (1)
src/routes/about/+page.svelte (6)

Learnt from: judah-sotomayor
PR: #820
File: src/lib/components/Modal.svelte:28-34
Timestamp: 2025-06-05T17:25:45.457Z
Learning: In the sillsdev/appbuilder-pwa repository, the Modal.svelte component has an existing bug where {{ id }.showModal()} syntax was used instead of calling the exported showModal function directly. This bug predates Svelte 5 migration efforts.

Learnt from: chrisvire
PR: #845
File: src/routes/text/+page.svelte:3-3
Timestamp: 2025-07-04T18:51:27.821Z
Learning: In SvelteKit 2.12 and Svelte 5, $app/stores was deprecated in favor of $app/state. When migrating from Svelte 4 to Svelte 5, imports should be changed from import { page } from '$app/stores'; to import { page } from '$app/state';. This change aligns with Svelte 5's reactivity model and provides more granular control over state updates.

Learnt from: judah-sotomayor
PR: #840
File: src/lib/components/NoteDialog.svelte:68-70
Timestamp: 2025-06-16T18:48:21.767Z
Learning: In Svelte 5, event handler syntax changed from Svelte 4. Use onclick={handler} instead of on:click={handler}. Event modifiers like |preventDefault are no longer supported and must be handled inside the handler function. Only one handler per event is allowed per element.

Learnt from: chrisvire
PR: #845
File: src/routes/text/+page.svelte:3-3
Timestamp: 2025-07-04T18:51:27.821Z
Learning: In Svelte 5, the page store is imported from $app/state instead of $app/stores. This is part of the migration from Svelte 4 to Svelte 5 where $app/stores is being deprecated in favor of $app/state.

Learnt from: judah-sotomayor
PR: #840
File: src/lib/components/NoteDialog.svelte:68-70
Timestamp: 2025-06-16T18:48:21.767Z
Learning: In Svelte 5, the event handler syntax has changed from Svelte 4. The onclick attribute is valid in Svelte 5, unlike Svelte 4 where on:click was required.

Learnt from: judah-sotomayor
PR: #850
File: src/routes/notes/edit/[noteid]/+page.js:0-0
Timestamp: 2025-06-23T20:54:56.765Z
Learning: In SvelteKit projects, verify the specific error handling pattern used in the codebase, as there may be variations from the standard throw error(status, message) syntax shown in official documentation.

✅ Files skipped from review due to trivial changes (3)
  • src/lib/components/HtmlBookView.svelte
  • src/lib/components/StackView.svelte
  • src/lib/components/TextSelectionToolbar.svelte
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/lib/components/ScriptureViewSofria.svelte
  • src/lib/components/LexiconEntryView.svelte
  • src/lib/data/stores/scripture.js
🧰 Additional context used
🧠 Learnings (1)
src/routes/about/+page.svelte (6)

Learnt from: judah-sotomayor
PR: #820
File: src/lib/components/Modal.svelte:28-34
Timestamp: 2025-06-05T17:25:45.457Z
Learning: In the sillsdev/appbuilder-pwa repository, the Modal.svelte component has an existing bug where {{ id }.showModal()} syntax was used instead of calling the exported showModal function directly. This bug predates Svelte 5 migration efforts.

Learnt from: chrisvire
PR: #845
File: src/routes/text/+page.svelte:3-3
Timestamp: 2025-07-04T18:51:27.821Z
Learning: In SvelteKit 2.12 and Svelte 5, $app/stores was deprecated in favor of $app/state. When migrating from Svelte 4 to Svelte 5, imports should be changed from import { page } from '$app/stores'; to import { page } from '$app/state';. This change aligns with Svelte 5's reactivity model and provides more granular control over state updates.

Learnt from: judah-sotomayor
PR: #840
File: src/lib/components/NoteDialog.svelte:68-70
Timestamp: 2025-06-16T18:48:21.767Z
Learning: In Svelte 5, event handler syntax changed from Svelte 4. Use onclick={handler} instead of on:click={handler}. Event modifiers like |preventDefault are no longer supported and must be handled inside the handler function. Only one handler per event is allowed per element.

Learnt from: chrisvire
PR: #845
File: src/routes/text/+page.svelte:3-3
Timestamp: 2025-07-04T18:51:27.821Z
Learning: In Svelte 5, the page store is imported from $app/state instead of $app/stores. This is part of the migration from Svelte 4 to Svelte 5 where $app/stores is being deprecated in favor of $app/state.

Learnt from: judah-sotomayor
PR: #840
File: src/lib/components/NoteDialog.svelte:68-70
Timestamp: 2025-06-16T18:48:21.767Z
Learning: In Svelte 5, the event handler syntax has changed from Svelte 4. The onclick attribute is valid in Svelte 5, unlike Svelte 4 where on:click was required.

Learnt from: judah-sotomayor
PR: #850
File: src/routes/notes/edit/[noteid]/+page.js:0-0
Timestamp: 2025-06-23T20:54:56.765Z
Learning: In SvelteKit projects, verify the specific error handling pattern used in the codebase, as there may be variations from the standard throw error(status, message) syntax shown in official documentation.

🔇 Additional comments (1)
src/routes/about/+page.svelte (1)

25-27: LGTM! Good documentation of security rationale.

The explanatory comments clearly justify why raw HTML injection is acceptable in this context (static asset source), and the ESLint directive appropriately suppresses the security warning. This approach properly balances security awareness with practical needs while maintaining code clarity.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • @coderabbitai modularize this function.
  • 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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

Copy link
Contributor

@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: 1

🧹 Nitpick comments (4)
src/lib/data/stores/theme.js (1)

57-65: Use Object.hasOwn for terser & cleaner checks

Great move switching away from a direct hasOwnProperty call.
Since Node 16 / modern browsers you can shorten the pattern to Object.hasOwn(obj, key), which is more readable and avoids touching the prototype chain entirely.

-        if (Object.prototype.hasOwnProperty.call(newProperties, 'background-color')) {
+        if (Object.hasOwn(newProperties, 'background-color')) {
...
-        if (Object.prototype.hasOwnProperty.call(newProperties, 'color')) {
+        if (Object.hasOwn(newProperties, 'color')) {

No behavioural change, just syntactic sugar.

src/routes/text/+page.svelte (1)

483-485: Consider using theme-driven color instead of hard-coding "gray"

Hard-coding the chevron color to the literal string "gray" makes it impossible for themes (e.g. dark mode, branded color palettes) to override the arrow colour. The rest of the component already pulls colours from $themeColors for run-time flexibility.

-<ChevronIcon size={36} color="gray" deg={$direction === 'ltr' ? 180 : 0} />
+<ChevronIcon
+    size={36}
+    color={$themeColors['IconChevron'] ?? 'gray'}
+    deg={$direction === 'ltr' ? 180 : 0}
/>

If a design-system token is not yet available, consider adding one so the navigation arrows follow the active theme automatically.

Also applies to: 517-518

src/lib/components/FontList.svelte (1)

26-36: Duplicate font-family inline style – keep only one declaration

<li> already sets style:font-family={font}; repeating it on the nested <a> is unnecessary and slightly increases bundle size.

-    <a
-        on:click={() => handleClick(font)}
-        style:background-color={font === selectedFont
-            ? $themeColors['ButtonSelectedColor']
-            : ''}
-        style:color={$monoIconColor}
-        style:font-family={font}
-        role="button"
-    >
+    <a
+        on:click={() => handleClick(font)}
+        style:background-color={font === selectedFont
+            ? $themeColors['ButtonSelectedColor']
+            : ''}
+        style:color={$monoIconColor}
+        role="button"
+    >

Trimming duplicate styles keeps the DOM cleaner and avoids accidental drift if one instance changes.

src/lib/components/TextSelectionToolbar.svelte (1)

188-191: Hard-coded "white" may clash with dark themes

The erase-highlight button uses a literal white background which becomes invisible on light themes and visually jarring on dark ones. Prefer re-using an existing theme colour or a semantic token.

-style:background-color="white"
+style:background-color={$themeColors['HighlighterPenErase'] ?? '#ffffff'}

Adding a dedicated erase colour to the theme palette keeps the UI consistent across themes.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8002e5f and 5585aff.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (34)
  • .eslintrc.cjs (0 hunks)
  • convert/convertBooks.ts (2 hunks)
  • convert/convertConfig.ts (3 hunks)
  • convert/convertReverseIndex.ts (1 hunks)
  • convert/tests/sab/convertConfigSAB.test.ts (1 hunks)
  • eslint.config.js (2 hunks)
  • example/index.ts (1 hunks)
  • package.json (3 hunks)
  • src/app.d.ts (0 hunks)
  • src/lib/components/BottomNavigationBar.svelte (1 hunks)
  • src/lib/components/FontList.svelte (1 hunks)
  • src/lib/components/HistoryCard.svelte (1 hunks)
  • src/lib/components/Sidebar.svelte (2 hunks)
  • src/lib/components/TextSelectionToolbar.svelte (1 hunks)
  • src/lib/data/analytics.ts (1 hunks)
  • src/lib/data/annotation-share.ts (1 hunks)
  • src/lib/data/audio.ts (3 hunks)
  • src/lib/data/catalogData.ts (1 hunks)
  • src/lib/data/highlights.ts (2 hunks)
  • src/lib/data/history.ts (2 hunks)
  • src/lib/data/language.ts (3 hunks)
  • src/lib/data/mrucache.ts (1 hunks)
  • src/lib/data/navigation.test.ts (3 hunks)
  • src/lib/data/scripture.js (1 hunks)
  • src/lib/data/stores/store-types.js (1 hunks)
  • src/lib/data/stores/theme.js (1 hunks)
  • src/lib/navigate/index.ts (2 hunks)
  • src/lib/search-worker/dab-search-worker.ts (1 hunks)
  • src/lib/search/data/test/search-config-repository-impl.test.ts (1 hunks)
  • src/lib/utils/worker-messenger/messenger.test.ts (1 hunks)
  • src/lib/video/index.ts (4 hunks)
  • src/routes/contents/[id]/+page.svelte (1 hunks)
  • src/routes/lexicon/+page.ts (2 hunks)
  • src/routes/text/+page.svelte (2 hunks)
💤 Files with no reviewable changes (2)
  • src/app.d.ts
  • .eslintrc.cjs
🧰 Additional context used
🧠 Learnings (11)
src/lib/components/FontList.svelte (2)
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#820
File: src/lib/components/Modal.svelte:28-34
Timestamp: 2025-06-05T17:25:45.457Z
Learning: In the sillsdev/appbuilder-pwa repository, the Modal.svelte component has an existing bug where `{{ id }.showModal()}` syntax was used instead of calling the exported `showModal` function directly. This bug predates Svelte 5 migration efforts.
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#840
File: src/lib/components/TextAppearanceSelector.svelte:165-197
Timestamp: 2025-06-16T18:47:15.122Z
Learning: In src/lib/components/TextAppearanceSelector.svelte, the user judah-sotomayor considers theme selection buttons not relevant for screen-reader users and prefers not to add accessibility labels to theme buttons.
src/lib/components/HistoryCard.svelte (3)
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#840
File: src/lib/components/NoteDialog.svelte:68-70
Timestamp: 2025-06-16T18:48:21.767Z
Learning: In Svelte 5, event handler syntax changed from Svelte 4. Use `onclick={handler}` instead of `on:click={handler}`. Event modifiers like `|preventDefault` are no longer supported and must be handled inside the handler function. Only one handler per event is allowed per element.
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#840
File: src/lib/components/NoteDialog.svelte:68-70
Timestamp: 2025-06-16T18:48:21.767Z
Learning: In Svelte 5, the event handler syntax has changed from Svelte 4. The `onclick` attribute is valid in Svelte 5, unlike Svelte 4 where `on:click` was required.
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#820
File: src/lib/components/Modal.svelte:28-34
Timestamp: 2025-06-05T17:25:45.457Z
Learning: In the sillsdev/appbuilder-pwa repository, the Modal.svelte component has an existing bug where `{{ id }.showModal()}` syntax was used instead of calling the exported `showModal` function directly. This bug predates Svelte 5 migration efforts.
src/routes/contents/[id]/+page.svelte (2)
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#820
File: src/lib/components/Modal.svelte:28-34
Timestamp: 2025-06-05T17:25:45.457Z
Learning: In the sillsdev/appbuilder-pwa repository, the Modal.svelte component has an existing bug where `{{ id }.showModal()}` syntax was used instead of calling the exported `showModal` function directly. This bug predates Svelte 5 migration efforts.
Learnt from: chrisvire
PR: sillsdev/appbuilder-pwa#845
File: src/routes/text/+page.svelte:3-3
Timestamp: 2025-07-04T18:51:27.821Z
Learning: In Svelte 5, the `page` store is imported from `$app/state` instead of `$app/stores`. This is part of the migration from Svelte 4 to Svelte 5 where `$app/stores` is being deprecated in favor of `$app/state`.
src/routes/text/+page.svelte (3)
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#840
File: src/lib/components/TextAppearanceSelector.svelte:165-197
Timestamp: 2025-06-16T18:47:15.122Z
Learning: In src/lib/components/TextAppearanceSelector.svelte, the user judah-sotomayor considers theme selection buttons not relevant for screen-reader users and prefers not to add accessibility labels to theme buttons.
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#820
File: src/lib/components/Modal.svelte:28-34
Timestamp: 2025-06-05T17:25:45.457Z
Learning: In the sillsdev/appbuilder-pwa repository, the Modal.svelte component has an existing bug where `{{ id }.showModal()}` syntax was used instead of calling the exported `showModal` function directly. This bug predates Svelte 5 migration efforts.
Learnt from: chrisvire
PR: sillsdev/appbuilder-pwa#845
File: src/routes/text/+page.svelte:3-3
Timestamp: 2025-07-04T18:51:27.821Z
Learning: In SvelteKit 2.12 and Svelte 5, `$app/stores` was deprecated in favor of `$app/state`. When migrating from Svelte 4 to Svelte 5, imports should be changed from `import { page } from '$app/stores';` to `import { page } from '$app/state';`. This change aligns with Svelte 5's reactivity model and provides more granular control over state updates.
src/lib/data/scripture.js (2)
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#850
File: src/routes/notes/edit/[noteid]/+page.js:0-0
Timestamp: 2025-06-23T20:54:56.765Z
Learning: In SvelteKit, the correct syntax for throwing HTTP errors in load functions is `error(statusCode, { message: 'error message' })` without the `throw` keyword. The error function from '@sveltejs/kit' should be called directly, not thrown like a regular JavaScript Error.
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#850
File: src/routes/notes/edit/[noteid]/+page.js:0-0
Timestamp: 2025-06-23T20:54:56.765Z
Learning: In SvelteKit projects, verify the specific error handling pattern used in the codebase, as there may be variations from the standard `throw error(status, message)` syntax shown in official documentation.
src/lib/components/BottomNavigationBar.svelte (3)
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#840
File: src/lib/components/NoteDialog.svelte:68-70
Timestamp: 2025-06-16T18:48:21.767Z
Learning: In Svelte 5, event handler syntax changed from Svelte 4. Use `onclick={handler}` instead of `on:click={handler}`. Event modifiers like `|preventDefault` are no longer supported and must be handled inside the handler function. Only one handler per event is allowed per element.
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#820
File: src/lib/components/Modal.svelte:28-34
Timestamp: 2025-06-05T17:25:45.457Z
Learning: In the sillsdev/appbuilder-pwa repository, the Modal.svelte component has an existing bug where `{{ id }.showModal()}` syntax was used instead of calling the exported `showModal` function directly. This bug predates Svelte 5 migration efforts.
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#840
File: src/lib/components/NoteDialog.svelte:68-70
Timestamp: 2025-06-16T18:48:21.767Z
Learning: In Svelte 5, the event handler syntax has changed from Svelte 4. The `onclick` attribute is valid in Svelte 5, unlike Svelte 4 where `on:click` was required.
src/lib/components/Sidebar.svelte (2)
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#840
File: src/lib/components/NoteDialog.svelte:68-70
Timestamp: 2025-06-16T18:48:21.767Z
Learning: In Svelte 5, event handler syntax changed from Svelte 4. Use `onclick={handler}` instead of `on:click={handler}`. Event modifiers like `|preventDefault` are no longer supported and must be handled inside the handler function. Only one handler per event is allowed per element.
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#820
File: src/lib/components/Modal.svelte:28-34
Timestamp: 2025-06-05T17:25:45.457Z
Learning: In the sillsdev/appbuilder-pwa repository, the Modal.svelte component has an existing bug where `{{ id }.showModal()}` syntax was used instead of calling the exported `showModal` function directly. This bug predates Svelte 5 migration efforts.
src/lib/data/stores/store-types.js (2)
Learnt from: chrisvire
PR: sillsdev/appbuilder-pwa#845
File: src/routes/text/+page.svelte:3-3
Timestamp: 2025-07-04T18:51:27.821Z
Learning: In SvelteKit 2.12 and Svelte 5, `$app/stores` was deprecated in favor of `$app/state`. When migrating from Svelte 4 to Svelte 5, imports should be changed from `import { page } from '$app/stores';` to `import { page } from '$app/state';`. This change aligns with Svelte 5's reactivity model and provides more granular control over state updates.
Learnt from: chrisvire
PR: sillsdev/appbuilder-pwa#845
File: src/routes/text/+page.svelte:3-3
Timestamp: 2025-07-04T18:51:27.821Z
Learning: In Svelte 5, the `page` store is imported from `$app/state` instead of `$app/stores`. This is part of the migration from Svelte 4 to Svelte 5 where `$app/stores` is being deprecated in favor of `$app/state`.
convert/convertBooks.ts (2)
Learnt from: chrisvire
PR: sillsdev/appbuilder-pwa#808
File: convert/convertMarkdown.ts:216-222
Timestamp: 2025-05-07T13:16:04.481Z
Learning: All USFM attribute encoding (href, title, etc.) should happen in the convertBooks process via the encodeJmpLinks function, not during the markdown to USFM conversion in convertMarkdown.ts.
Learnt from: chrisvire
PR: sillsdev/appbuilder-pwa#808
File: convert/convertMarkdown.ts:216-222
Timestamp: 2025-05-07T13:16:04.481Z
Learning: The USFM attribute encoding workflow in appbuilder-pwa has two distinct steps: (1) Markdown to USFM conversion in convertMarkdown.ts should NOT encode attributes like title or href, (2) The encoding of these attributes should happen only in the convertBooks.ts process via the encodeJmpLinks function to prevent double-encoding.
src/lib/components/TextSelectionToolbar.svelte (4)
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#840
File: src/lib/components/TextAppearanceSelector.svelte:165-197
Timestamp: 2025-06-16T18:47:15.122Z
Learning: In src/lib/components/TextAppearanceSelector.svelte, the user judah-sotomayor considers theme selection buttons not relevant for screen-reader users and prefers not to add accessibility labels to theme buttons.
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#840
File: src/lib/components/NoteDialog.svelte:68-70
Timestamp: 2025-06-16T18:48:21.767Z
Learning: In Svelte 5, event handler syntax changed from Svelte 4. Use `onclick={handler}` instead of `on:click={handler}`. Event modifiers like `|preventDefault` are no longer supported and must be handled inside the handler function. Only one handler per event is allowed per element.
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#840
File: src/lib/components/NoteDialog.svelte:68-70
Timestamp: 2025-06-16T18:48:21.767Z
Learning: In Svelte 5, the event handler syntax has changed from Svelte 4. The `onclick` attribute is valid in Svelte 5, unlike Svelte 4 where `on:click` was required.
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#820
File: src/lib/components/Modal.svelte:28-34
Timestamp: 2025-06-05T17:25:45.457Z
Learning: In the sillsdev/appbuilder-pwa repository, the Modal.svelte component has an existing bug where `{{ id }.showModal()}` syntax was used instead of calling the exported `showModal` function directly. This bug predates Svelte 5 migration efforts.
package.json (2)
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#840
File: src/lib/components/NoteDialog.svelte:94-95
Timestamp: 2025-06-16T18:49:02.188Z
Learning: The appbuilder-pwa project uses Svelte 5, as evidenced by "svelte": "^5" in package.json and the use of Svelte 5 runes syntax like $props() and $derived(). In Svelte 5, onclick is the preferred event handler syntax over on:click.
Learnt from: chrisvire
PR: sillsdev/appbuilder-pwa#845
File: src/routes/text/+page.svelte:3-3
Timestamp: 2025-07-04T18:51:27.821Z
Learning: In SvelteKit 2.12 and Svelte 5, `$app/stores` was deprecated in favor of `$app/state`. When migrating from Svelte 4 to Svelte 5, imports should be changed from `import { page } from '$app/stores';` to `import { page } from '$app/state';`. This change aligns with Svelte 5's reactivity model and provides more granular control over state updates.
🧬 Code Graph Analysis (3)
convert/convertReverseIndex.ts (1)
convert/Task.ts (1)
  • FileContent (1-4)
src/lib/search-worker/dab-search-worker.ts (1)
src/lib/data/stores/lexicon.ts (1)
  • initializeDatabase (48-69)
src/routes/lexicon/+page.ts (1)
src/lib/data/stores/lexicon.ts (1)
  • initializeDatabase (48-69)
⏰ 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). (2)
  • GitHub Check: lint
  • GitHub Check: test
🔇 Additional comments (47)
src/lib/data/stores/store-types.js (1)

15-18: Safer property-existence check looks good

Replacing stores.hasOwnProperty(key) with the prototype-safe call eliminates edge-case bugs if stores ever shadows hasOwnProperty. Change is correct and side-effect free.

src/lib/search/data/test/search-config-repository-impl.test.ts (1)

33-33: LGTM! Critical test assertion fix.

This correctly fixes the test assertion by adding parentheses to properly invoke the toBeDefined() matcher. Without parentheses, the assertion would never execute, making the test ineffective.

src/lib/utils/worker-messenger/messenger.test.ts (1)

253-253: LGTM! Consistent test assertion fix.

This correctly fixes the test assertion by adding parentheses to properly invoke the toBeDefined() matcher. This change is consistent with similar fixes across the codebase and ensures the test actually validates that io.lastPosted is defined.

src/lib/data/catalogData.ts (2)

16-16: No breaking changes detected for sequences type

All occurrences of sequences are initialized with objects or empty arrays—no primitives are ever assigned. The change from {} to object is safe.


24-25: CatalogData’s tags and quizzes Remain Object-Only and No Primitives Found

All usages assign plain objects ({ … }), object maps ({ [key: string]: string }), or any → object, and no primitive values are ever assigned to tags or quizzes. Key findings:

• sab-proskomma-tools/post-query/catalog.ts assigns tags as { [key: string]: string }
• src/lib/data/navigation.test.ts uses {} literals for both properties
• convert/convertBooks.ts writes through any, which is allowed by object

No breaking changes detected—type tightening to object is safe.

src/lib/data/history.ts (1)

48-48: LGTM! Good use of const for immutable variables.

Converting these let declarations to const is appropriate since the history variable is only assigned once and never reassigned in both functions. This change enforces immutability and follows modern JavaScript best practices.

Also applies to: 67-67

src/lib/data/annotation-share.ts (1)

20-20: LGTM! Proper use of const for immutable variables.

Converting these let declarations to const is correct since the text variable is assigned once and never reassigned in both functions. This enforces immutability and aligns with modern JavaScript best practices.

Also applies to: 25-28

src/lib/data/mrucache.ts (1)

40-40: LGTM! Correct use of const in for-of loop.

Using const for the destructured loop variables is appropriate since they shouldn't be reassigned within the loop body. This follows modern JavaScript best practices and prevents accidental modification of loop variables.

src/lib/navigate/index.ts (1)

10-11: Disabling ESLint Rule for Hash-Based Navigation is Appropriate

The svelte/no-navigation-without-base rule is enforced as an error in eslint.config.js to guard against missing base-path navigation, but our custom hash-based routing (via getRoute(route) which prepends the base) and full-URL navigations aren’t recognized by this rule. Inline disabling here is the simplest, correct approach—no underlying pattern change is needed.

Locations to note:

  • src/lib/navigate/index.ts: lines 10–11
  • src/lib/navigate/index.ts: lines 24–25
src/lib/data/language.ts (1)

21-21: LGTM! Excellent use of const for immutable variables.

All these variable declaration changes are appropriate improvements:

  • similarity is assigned once from compareLanguages() call
  • match is assigned once from findLanguage() call
  • parts1 and parts2 are assigned once from split() calls

Using const enforces immutability and follows modern JavaScript best practices without affecting functionality.

Also applies to: 40-40, 69-70

src/lib/data/scripture.js (1)

73-75: LGTM - Improved clarity with explicit intent comment

Adding the comment clarifies that the empty catch block is intentional, which is a good practice for maintainability.

convert/convertBooks.ts (2)

152-152: LGTM - Appropriate const usage

Changing to const is correct since imageCaption is never reassigned after initial assignment.


239-239: LGTM - Standard for-of loop pattern

Using const in for-of loops is the recommended pattern since each iteration gets a new const binding.

example/index.ts (1)

25-29: LGTM - Improved consistency with explicit block scoping

Adding curly braces makes the darwin case consistent with other cases in the switch statement and provides explicit block scoping.

src/lib/data/highlights.ts (2)

70-70: LGTM - Modern loop variable declaration

Changing from var to let provides proper block scoping for the loop variable, following modern JavaScript best practices.


125-125: LGTM - Consistent block scoping

Using let instead of var for the loop variable provides block scoping and aligns with modern JavaScript conventions.

src/lib/components/Sidebar.svelte (2)

50-52: LGTM - Improved readability with explicit if statement

Converting the ternary expression to an explicit if statement makes the escape key handling more readable and clear.


261-268: LGTM - Appropriate ESLint rule suppression

The ESLint disable comments are correctly applied for external menu item links that intentionally don't use the base path, which is a valid exception to the svelte/no-navigation-without-base rule.

src/lib/components/HistoryCard.svelte (1)

30-30: LGTM! Appropriate ESLint suppression for navigation.

This targeted suppression aligns with the PR's ESLint integration objectives and follows the pattern mentioned in the AI summary for similar navigation components.

src/lib/data/navigation.test.ts (3)

249-249: Good immutability improvement.

Changing to const is appropriate since config2 is not reassigned after initialization.


274-274: Good immutability improvement.

Changing to const is appropriate since config2 is not reassigned after initialization.


459-459: Good immutability improvement.

Changing to const is appropriate since config2 is not reassigned after initialization.

convert/convertConfig.ts (3)

896-902: Good immutability improvement.

Changing to const is appropriate since translationMappings is only modified via property assignments, never reassigned.


990-990: Good immutability improvement.

Changing to const is appropriate since firebase is only modified via property assignments, never reassigned.


1164-1164: Good immutability improvement.

Changing to const is appropriate since defaultLayout is not reassigned after initialization.

convert/convertReverseIndex.ts (1)

149-149: Good immutability improvement.

Changing to const is appropriate since files is only mutated via push() operations, never reassigned.

src/routes/lexicon/+page.ts (3)

54-54: Good immutability improvement.

Changing to const is appropriate since db is not reassigned after the async initialization.


55-57: Excellent improvements to both immutability and readability.

The change to const is appropriate since results is not reassigned, and the multi-line SQL query formatting significantly improves readability.


78-80: Good immutability and style improvement.

Changing to const and combining declaration with assignment is more concise and appropriate since firstTwoChars is not reassigned.

convert/tests/sab/convertConfigSAB.test.ts (1)

108-109: Excellent improvement to test assertion clarity!

The original assertion expect(bkk.chapters).not.toBe(0 || undefined) had a logical flaw since 0 || undefined evaluates to undefined. The new approach with separate assertions correctly validates both conditions: that chapters is not 0 and that it's defined.

src/lib/data/analytics.ts (1)

90-92: Good TypeScript best practice improvement!

Changing from boxed String type to primitive string type aligns with TypeScript best practices. Primitive types are preferred over their boxed counterparts in TypeScript type annotations.

src/lib/data/audio.ts (5)

75-75: Good improvement using const for immutable DOM elements!

Replacing var with const for DOM source elements that are not reassigned improves code safety and follows modern JavaScript practices.


82-82: Consistent improvement with const declaration!

Good use of const for the CAF source element that's not reassigned.


86-86: Proper const usage for MP3 source element!

Correctly using const for the MP3 source element that's created once and not reassigned.


95-95: Appropriate const declaration for MP3 source!

Good use of const for the MP3 source element in the 3GP case.


479-479: Excellent use of const for regex test result!

The containsAlpha variable is assigned once from a regex test and never reassigned, making const the appropriate choice here.

src/lib/search-worker/dab-search-worker.ts (2)

10-10: Good use of const for database reference!

The db variable is assigned once from initializeDatabase and never reassigned, making const the appropriate choice.


13-16: Excellent improvements to both variable declaration and formatting!

Using const for the results variable is appropriate since it's assigned once and not reassigned. The improved SQL query formatting with proper line breaks also enhances readability.

src/lib/video/index.ts (5)

72-95: Excellent addition of block scoping for YouTube case!

Adding braces around the case block prevents potential variable name conflicts between cases and improves code clarity. This is a good practice when declaring variables within switch cases.


97-113: Good block scoping and const usage for Vimeo case!

The block scoping braces prevent variable conflicts, and using const for pattern and match variables is appropriate since they're not reassigned within the case.


114-122: Proper block scoping and immutable variables for Daily case!

Consistent application of block scoping and const declarations for variables that aren't reassigned.


124-133: Clean block scoping for Jesus case!

Good addition of block scoping braces for consistency with other cases.


135-138: Consistent block scoping for HLS case!

Maintaining consistency with block scoping across all switch cases, even for simple ones.

package.json (1)

36-44: LGTM! ESLint and related packages upgraded successfully.

The upgrades to ESLint v9.30.1, typescript-eslint v8.36.0, and eslint-plugin-svelte v3.10.1 align well with the PR objectives for modernizing the ESLint configuration.

Also applies to: 56-56

eslint.config.js (1)

1-92: Excellent ESLint configuration with proper Prettier integration!

The new flat config format is well-structured with:

  • Proper integration of TypeScript, Svelte, and Prettier configurations
  • Appropriate rule overrides aligned with the PR objectives
  • Good use of svelteConfig for enhanced Svelte rule compatibility
src/routes/contents/[id]/+page.svelte (1)

59-65: Good fix for proper case block scoping.

Adding braces to the case statement creates proper block scope and prevents potential variable declaration issues.

src/lib/components/BottomNavigationBar.svelte (1)

71-75: Consistent case block scoping improvement.

The addition of braces properly scopes the gotoLink variable declaration within the case block.

Add the `curly` rule to enforce use of braces in if-statements.
Then run `eslint . --fix` to correct all violations, and `prettier
--write .` to reformat.
Copy link
Contributor

@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 (4)
src/lib/search-worker/data/repositories/pk-search-repository-impl.ts (1)

62-62: Fix the typo in the method name.

The method name phraseIsEmtpy has a typo - it should be phraseIsEmpty (missing 'p' in 'Empty').

Apply this diff to fix the typo:

-    private phraseIsEmtpy(phrase: string) {
+    private phraseIsEmpty(phrase: string) {

And update the method calls:

-        if (this.phraseIsEmtpy(phrase)) {
+        if (this.phraseIsEmpty(phrase)) {
-        if (this.phraseIsEmtpy(phrase)) {
+        if (this.phraseIsEmpty(phrase)) {

Also applies to: 83-83, 112-112

src/lib/search-worker/domain/test/search-session-internal.test.ts (1)

126-130: LGTM! Good stylistic improvement with a minor formatting fix needed.

The addition of explicit braces around the else block improves code consistency and readability, aligning with the broader ESLint configuration changes in this PR.

However, there's a minor formatting inconsistency in the error message on line 128.

Apply this diff to fix the formatting inconsistency:

-                `expected new query responses, but got types '${response1.type}' and ${response2.type}`
+                `expected new query responses, but got types '${response1.type}' and '${response2.type}'`
convert/convertContents.ts (1)

196-196: Consider using optional chaining for cleaner conditional logic

The current book && book.type check can be simplified using optional chaining.

-                    if (book && book.type) {
+                    if (book?.type) {
convert/convertConfig.ts (1)

34-36: Simplify the useless ternary operator.

The ternary operator value === 'true' ? true : false is redundant since the comparison already returns a boolean.

-} else if (['true', 'false'].includes(value)) {
-    value = value === 'true' ? true : false;
-}
+} else if (['true', 'false'].includes(value)) {
+    value = value === 'true';
+}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5585aff and 740a9ee.

📒 Files selected for processing (35)
  • convert/convertAbout.ts (1 hunks)
  • convert/convertBadges.ts (1 hunks)
  • convert/convertBooks.ts (11 hunks)
  • convert/convertConfig.ts (37 hunks)
  • convert/convertContents.ts (1 hunks)
  • convert/convertFirebase.ts (1 hunks)
  • convert/convertManifest.ts (1 hunks)
  • convert/convertMedia.ts (3 hunks)
  • convert/convertReverseIndex.ts (3 hunks)
  • convert/convertSQLite.ts (1 hunks)
  • convert/convertStyles.ts (3 hunks)
  • convert/index.ts (1 hunks)
  • eslint.config.js (2 hunks)
  • src/lib/components/AudioBar.svelte (1 hunks)
  • src/lib/components/HorizontalPanes.svelte (3 hunks)
  • src/lib/components/LexiconEntryView.svelte (2 hunks)
  • src/lib/components/ScriptureViewSofria.svelte (1 hunks)
  • src/lib/components/SearchForm.svelte (1 hunks)
  • src/lib/components/TabsMenu.svelte (1 hunks)
  • src/lib/components/VerticalPanes.svelte (3 hunks)
  • src/lib/data/audio.ts (8 hunks)
  • src/lib/data/stores/collection.ts (1 hunks)
  • src/lib/data/stores/scripture.js (1 hunks)
  • src/lib/scripts/query.js (1 hunks)
  • src/lib/scripts/render.js (1 hunks)
  • src/lib/search-worker/data/pk-verse-provider.ts (2 hunks)
  • src/lib/search-worker/data/repositories/pk-search-repository-impl.ts (2 hunks)
  • src/lib/search-worker/domain/test/search-session-internal.test.ts (1 hunks)
  • src/lib/search/domain/search-query-manager-impl.ts (2 hunks)
  • src/routes/lexicon/+page.svelte (1 hunks)
  • src/routes/plans/[id]/+page.svelte (1 hunks)
  • src/routes/quiz/[collection]/[id]/+page.svelte (1 hunks)
  • src/routes/search/[collection]/[[savedResults]]/+page.ts (1 hunks)
  • src/routes/text/+page.svelte (3 hunks)
  • src/service-worker.js (2 hunks)
✅ Files skipped from review due to trivial changes (18)
  • src/routes/quiz/[collection]/[id]/+page.svelte
  • src/lib/components/SearchForm.svelte
  • convert/convertManifest.ts
  • src/routes/search/[collection]/[[savedResults]]/+page.ts
  • convert/convertFirebase.ts
  • src/lib/data/stores/scripture.js
  • convert/convertAbout.ts
  • src/lib/scripts/render.js
  • src/lib/search/domain/search-query-manager-impl.ts
  • src/lib/data/stores/collection.ts
  • src/lib/scripts/query.js
  • src/lib/search-worker/data/pk-verse-provider.ts
  • convert/convertBadges.ts
  • src/service-worker.js
  • src/lib/components/HorizontalPanes.svelte
  • convert/convertStyles.ts
  • convert/convertBooks.ts
  • src/lib/components/TabsMenu.svelte
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/routes/text/+page.svelte
  • convert/convertReverseIndex.ts
  • src/lib/data/audio.ts
  • eslint.config.js
🧰 Additional context used
🧠 Learnings (4)
src/routes/plans/[id]/+page.svelte (2)
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#840
File: src/lib/components/NoteDialog.svelte:68-70
Timestamp: 2025-06-16T18:48:21.767Z
Learning: In Svelte 5, event handler syntax changed from Svelte 4. Use `onclick={handler}` instead of `on:click={handler}`. Event modifiers like `|preventDefault` are no longer supported and must be handled inside the handler function. Only one handler per event is allowed per element.
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#820
File: src/lib/components/Modal.svelte:28-34
Timestamp: 2025-06-05T17:25:45.457Z
Learning: In the sillsdev/appbuilder-pwa repository, the Modal.svelte component has an existing bug where `{{ id }.showModal()}` syntax was used instead of calling the exported `showModal` function directly. This bug predates Svelte 5 migration efforts.
src/lib/components/VerticalPanes.svelte (4)
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#840
File: src/lib/components/NoteDialog.svelte:68-70
Timestamp: 2025-06-16T18:48:21.767Z
Learning: In Svelte 5, event handler syntax changed from Svelte 4. Use `onclick={handler}` instead of `on:click={handler}`. Event modifiers like `|preventDefault` are no longer supported and must be handled inside the handler function. Only one handler per event is allowed per element.
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#840
File: src/lib/components/NoteDialog.svelte:68-70
Timestamp: 2025-06-16T18:48:21.767Z
Learning: In Svelte 5, the event handler syntax has changed from Svelte 4. The `onclick` attribute is valid in Svelte 5, unlike Svelte 4 where `on:click` was required.
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#820
File: src/lib/components/Modal.svelte:28-34
Timestamp: 2025-06-05T17:25:45.457Z
Learning: In the sillsdev/appbuilder-pwa repository, the Modal.svelte component has an existing bug where `{{ id }.showModal()}` syntax was used instead of calling the exported `showModal` function directly. This bug predates Svelte 5 migration efforts.
Learnt from: judah-sotomayor
PR: sillsdev/appbuilder-pwa#840
File: src/lib/components/NoteDialog.svelte:94-95
Timestamp: 2025-06-16T18:49:02.188Z
Learning: The appbuilder-pwa project uses Svelte 5, as evidenced by "svelte": "^5" in package.json and the use of Svelte 5 runes syntax like $props() and $derived(). In Svelte 5, onclick is the preferred event handler syntax over on:click.
convert/convertConfig.ts (2)
Learnt from: chrisvire
PR: sillsdev/appbuilder-pwa#808
File: convert/convertMarkdown.ts:216-222
Timestamp: 2025-05-07T13:16:04.481Z
Learning: All USFM attribute encoding (href, title, etc.) should happen in the convertBooks process via the encodeJmpLinks function, not during the markdown to USFM conversion in convertMarkdown.ts.
Learnt from: chrisvire
PR: sillsdev/appbuilder-pwa#808
File: convert/convertMarkdown.ts:216-222
Timestamp: 2025-05-07T13:16:04.481Z
Learning: The USFM attribute encoding workflow in appbuilder-pwa has two distinct steps: (1) Markdown to USFM conversion in convertMarkdown.ts should NOT encode attributes like title or href, (2) The encoding of these attributes should happen only in the convertBooks.ts process via the encodeJmpLinks function to prevent double-encoding.
convert/convertContents.ts (2)
Learnt from: chrisvire
PR: sillsdev/appbuilder-pwa#808
File: convert/convertMarkdown.ts:216-222
Timestamp: 2025-05-07T13:16:04.481Z
Learning: All USFM attribute encoding (href, title, etc.) should happen in the convertBooks process via the encodeJmpLinks function, not during the markdown to USFM conversion in convertMarkdown.ts.
Learnt from: chrisvire
PR: sillsdev/appbuilder-pwa#808
File: convert/convertMarkdown.ts:216-222
Timestamp: 2025-05-07T13:16:04.481Z
Learning: The USFM attribute encoding workflow in appbuilder-pwa has two distinct steps: (1) Markdown to USFM conversion in convertMarkdown.ts should NOT encode attributes like title or href, (2) The encoding of these attributes should happen only in the convertBooks.ts process via the encodeJmpLinks function to prevent double-encoding.
🪛 Biome (1.9.4)
convert/convertConfig.ts

[error] 35-35: Unnecessary use of boolean literals in conditional expression.

Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with

(lint/complexity/noUselessTernary)

convert/convertContents.ts

[error] 196-196: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

⏰ 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). (2)
  • GitHub Check: lint
  • GitHub Check: test
🔇 Additional comments (14)
src/lib/search-worker/data/repositories/pk-search-repository-impl.ts (2)

62-64: LGTM on the formatting change.

The addition of explicit braces around the early return statement improves code consistency and aligns with the ESLint configuration updates mentioned in the PR objectives.


83-85: LGTM on the formatting change.

The addition of explicit braces around the early return statement improves code consistency and aligns with the ESLint configuration updates mentioned in the PR objectives.

src/lib/components/AudioBar.svelte (1)

43-45: LGTM! Consistent brace style improvement.

The expansion of the single-line conditional to use explicit braces aligns with ESLint's curly braces rule and improves code readability and consistency across the codebase.

src/routes/plans/[id]/+page.svelte (1)

172-174: LGTM! Consistent with codebase style improvements.

The expansion of the single-line conditional to use explicit braces maintains consistency with the broader style improvements across the codebase and enhances readability.

src/routes/lexicon/+page.svelte (1)

191-193: LGTM! Proper brace style enforcement.

The expansion of the single-line conditional to use explicit braces aligns with ESLint rules and improves code consistency throughout the codebase.

convert/convertMedia.ts (1)

23-28: LGTM! Consistent brace style across all conditionals.

The expansion of single-line conditional statements to use explicit braces throughout the file maintains consistency with ESLint rules and improves code readability. The logic for verbose logging and error handling remains unchanged.

Also applies to: 31-33, 47-54, 120-122

convert/convertSQLite.ts (1)

18-23: LGTM! Consistent brace style in callback functions.

The expansion of single-line conditional statements to use explicit braces in the copyFile callbacks maintains consistency with ESLint rules and improves code readability. The error handling and logging logic remains unchanged.

Also applies to: 29-34

convert/convertContents.ts (1)

192-194: LGTM: Improved code consistency with explicit braces

The addition of braces around single-line conditionals enhances readability and aligns with consistent coding standards throughout the codebase.

Also applies to: 198-200

convert/index.ts (1)

128-130: LGTM: Improved code consistency with explicit braces

The addition of braces around single-line conditionals enhances readability and maintains consistent formatting throughout the file watching logic.

Also applies to: 132-134

src/lib/components/LexiconEntryView.svelte (1)

37-39: LGTM: Improved code consistency with explicit braces

The addition of braces around single-line conditionals enhances readability and maintains consistent formatting throughout the component logic.

Also applies to: 200-202

src/lib/components/ScriptureViewSofria.svelte (1)

1364-1366: LGTM! Good stylistic improvement for consistency.

This change converts a single-line conditional early return to use explicit braces, which improves code readability and consistency with the broader codebase formatting updates mentioned in the PR objectives.

src/lib/components/VerticalPanes.svelte (1)

21-23: LGTM: Consistent bracing improves code clarity.

The addition of explicit braces to all conditional statements enhances code readability and consistency. The logic for pointer event handling remains unchanged while following modern JavaScript style conventions.

Also applies to: 32-34, 35-37, 49-51

convert/convertConfig.ts (2)

970-976: LGTM: Proper use of const for immutable variables.

The changes from let to const for translationMappings, firebase, and defaultLayout are appropriate since these variables are not reassigned after initialization. This improves code clarity and prevents accidental mutations.

Also applies to: 1073-1073, 1261-1261


228-230: LGTM: Consistent bracing improves code maintainability.

The systematic addition of braces to all conditional statements throughout the file enhances code consistency and readability. This aligns with modern JavaScript/TypeScript style guides and ESLint best practices, making the codebase more maintainable.

Also applies to: 234-236, 405-407, 430-432, 447-449, 461-467, 468-470, 473-475, 488-490, 493-495, 503-505, 508-510, 530-532, 542-544, 546-548, 550-552, 561-563, 567-569, 580-582, 587-589, 602-604, 644-646, 769-771, 777-779, 781-783, 785-787, 795-797, 812-814, 819-821, 823-825, 850-855, 858-864, 890-894, 983-985, 992-994, 997-1001, 1011-1013, 1065-1067, 1094-1096, 1120-1122, 1146-1148, 1158-1160, 1168-1170, 1213-1215, 1253-1255, 1268-1270, 1298-1300, 1318-1320, 1338-1340, 1352-1354, 1355-1357, 1405-1407, 1433-1435, 1478-1480

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