Skip to content

Conversation

@KATO-Hiro
Copy link
Collaborator

@KATO-Hiro KATO-Hiro commented Jun 18, 2025

close #2197

Summary by CodeRabbit

  • Refactor

    • Modernized ESLint configuration to use the latest flat config format, updated Svelte parser and plugin imports, and added Svelte 5 global variables.
    • Updated TypeScript and Svelte linting rules for improved clarity and consistency.
    • Upgraded the eslint-plugin-svelte package to the latest version.
  • Style

    • Simplified template syntax in several components by using direct text nodes instead of expressions wrapped in braces.
    • Removed unnecessary ESLint comments and cleaned up minor code formatting in Svelte files.

@coderabbitai
Copy link

coderabbitai bot commented Jun 18, 2025

Walkthrough

The ESLint configuration was updated to adopt the modern flat config style, removing deprecated FlatCompat usage. The eslint-plugin-svelte dependency was upgraded from version 2.46.1 to 3.9.2. Several Svelte and TypeScript linting rules were refined, and minor template syntax cleanups were made in Svelte component files.

Changes

File(s) Change Summary
eslint.config.mjs Refactored to flat config, removed FlatCompat, updated Svelte/TS rules, added Svelte 5 globals.
package.json Upgraded eslint-plugin-svelte from 2.46.1 to 3.9.2.
src/lib/components/GradeLabel.svelte
src/lib/components/SubmissionStatus/IconForUpdating.svelte
src/lib/components/SubmissionStatus/SubmissionStatusImage.svelte
src/routes/+error.svelte
src/routes/workbooks/[slug]/+page.svelte
src/routes/workbooks/create/+page.svelte
Simplified template syntax: removed unnecessary braces around string literals and cleaned up comments.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant ESLint
    participant SveltePlugin
    participant TypeScriptESLint

    Developer->>ESLint: Run lint
    ESLint->>SveltePlugin: Apply flat config, Svelte 3.x rules
    ESLint->>TypeScriptESLint: Apply updated TS rules
    SveltePlugin-->>ESLint: Lint Svelte files (with new globals/rules)
    TypeScriptESLint-->>ESLint: Lint TS files (with updated rules)
    ESLint-->>Developer: Report results
Loading

Assessment against linked issues

Objective Addressed Explanation
Upgrade eslint-plugin-svelte from 2.46.1 to 3.x (#2197)

Poem

In the warren where the code does dwell,
A bunny hopped in with linting to quell.
Svelte’s plugin is shiny, now version three,
Flat configs are tidy as configs can be!
With templates cleaned up and rules in line,
This rabbit declares: your code is divine!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 2931795 and 60b024f.

📒 Files selected for processing (1)
  • eslint.config.mjs (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • eslint.config.mjs
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: preview
✨ 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

@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 (3)
src/lib/components/SubmissionStatus/SubmissionStatusImage.svelte (1)

30-31: Consider extracting hard-coded Japanese text for i18n

The literal 更新 is now directly embedded in the markup. If you intend to support multiple locales, consider routing this through your existing i18n / translation helper instead of hard-coding the string in the component.

src/routes/workbooks/[slug]/+page.svelte (1)

223-225: Minor: keep user-facing strings centrally managed

The hint “問題を1問以上登録してください。” is now an inline text node. For consistency and future localisation, route this string through the same translation / message catalogue used elsewhere in the app.

eslint.config.mjs (1)

33-35: Config order may silently override rules

Placing js.configs.recommended before sveltePlugin’s preset means later spreads will override base JS rules.
That is fine if intended; otherwise swap the two to inherit Svelte rules on top of JS ones.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between a6f67e2 and 1dc053a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • eslint.config.mjs (4 hunks)
  • package.json (1 hunks)
  • src/lib/components/GradeLabel.svelte (1 hunks)
  • src/lib/components/SubmissionStatus/IconForUpdating.svelte (1 hunks)
  • src/lib/components/SubmissionStatus/SubmissionStatusImage.svelte (1 hunks)
  • src/routes/+error.svelte (1 hunks)
  • src/routes/workbooks/[slug]/+page.svelte (1 hunks)
  • src/routes/workbooks/create/+page.svelte (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: preview
🔇 Additional comments (8)
package.json (1)

49-49: Bump eslint-plugin-svelte version
Upgrades from 2.46.1 to 3.9.2 to align with the new flat config and Svelte 5 support.
Ensure you run your lint pipeline (pnpm lint) to catch any new rule or parser issues.

src/routes/+error.svelte (1)

24-24: Simplify button text syntax
Switches to a direct text node for “ホームに戻る” instead of a JS expression—no logic change.

src/routes/workbooks/create/+page.svelte (1)

31-31: Streamline breadcrumbTitle prop
Replaces the JS expression {'問題集を作成'} with a plain string—purely cosmetic.

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

49-49: Use direct minus character
Renders the minus sign () as a literal instead of a wrapped expression—style-only change.

src/lib/components/SubmissionStatus/IconForUpdating.svelte (1)

15-15: Remove unnecessary braces around static text
Inlines “更新” directly rather than using a JS expression—no functional impact.

eslint.config.mjs (3)

7-9: Missing .default when using ESM-style plugin import?

eslint-plugin-svelte published via export = in CJS; when imported using import sveltePlugin from 'eslint-plugin-svelte'; the actual object may live under default.
If you encounter “Cannot read property ‘configs’ of undefined”, adjust to:

-import sveltePlugin from 'eslint-plugin-svelte';
+import sveltePlugin from 'eslint-plugin-svelte';
+// for CJS default export interop:
+const sveltePluginCfg = (sveltePlugin.default ?? sveltePlugin);
...
-...sveltePlugin.configs['flat/recommended'],
+...sveltePluginCfg.configs['flat/recommended'],

44-51: 👍 Good addition of Svelte-5 rune globals


70-80: Duplicate “unused-vars” checking

@typescript-eslint/no-unused-vars is enabled, but the base rule is disabled only later at line 78.
This is correct, just highlighting that ESLint will still report the base rule until it is hit by the override. No change required.

Copy link
Collaborator Author

@KATO-Hiro KATO-Hiro left a comment

Choose a reason for hiding this comment

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

LGTM

@KATO-Hiro KATO-Hiro merged commit 9f55c49 into staging Jun 18, 2025
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #2197 branch June 18, 2025 09:38
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.

[Library] eslint-plugin-svelte 2.46.1から3.xにアップデートしましょう

2 participants