Skip to content

🧹 fix(lint): configure ESLint to allow img tags in BusinessCard#123

Closed
is0692vs wants to merge 2 commits intomainfrom
fix/business-card-eslint-img-tags-5884096278838244657
Closed

🧹 fix(lint): configure ESLint to allow img tags in BusinessCard#123
is0692vs wants to merge 2 commits intomainfrom
fix/business-card-eslint-img-tags-5884096278838244657

Conversation

@is0692vs
Copy link
Copy Markdown
Contributor

@is0692vs is0692vs commented Apr 3, 2026

🎯 What: Configured eslint.config.mjs to disable the @next/next/no-img-element rule for src/components/BusinessCard.tsx and src/lib/cardRenderer.tsx and removed inline suppression comments.

💡 Why: BusinessCard and cardRenderer explicitly require standard <img> tags (rather than Next.js <Image /> tags) for the html-to-image rendering engine to work correctly. Disabling the rule in the global configuration for these files avoids noisy inline eslint-disable comments. This improves code readability and maintainability.

Verification: Verified by running npx eslint src/components/BusinessCard.tsx src/lib/cardRenderer.tsx with no warnings, and confirmed no test regressions or build errors via npm run test -- --run and npm run build.

Result: Clean code health with consistent lint configuration and no lint suppression comments cluttering the codebase.


PR created automatically by Jules for task 5884096278838244657 started by @is0692vs

- Configured `eslint.config.mjs` to disable `@next/next/no-img-element` rule for `BusinessCard` and `cardRenderer` components.
- Removed inline `eslint-disable-next-line` comments for cleaner code.
- Maintained usage of standard `<img>` tags required for correct `html-to-image` rendering.

Co-authored-by: is0692vs <135803462+is0692vs@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
github-user-summary Ready Ready Preview, Comment Apr 12, 2026 4:14pm

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Configure ESLint to allow img tags in BusinessCard

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Configured ESLint to disable @next/next/no-img-element rule for specific files
• Removed inline eslint-disable-next-line comments from components
• Maintains standard <img> tags required for html-to-image rendering
Diagram
flowchart LR
  A["ESLint Config"] -->|"disable rule for files"| B["eslint.config.mjs"]
  B -->|"applies to"| C["BusinessCard.tsx"]
  B -->|"applies to"| D["cardRenderer.tsx"]
  C -->|"remove comment"| E["Clean img tag"]
  D -->|"remove comment"| F["Clean img tag"]
Loading

Grey Divider

File Changes

1. eslint.config.mjs ⚙️ Configuration changes +6/-0

Add ESLint rule override for img tags

• Added configuration block to disable @next/next/no-img-element rule
• Targets src/components/BusinessCard.tsx and src/lib/cardRenderer.tsx files
• Allows standard <img> tags for html-to-image rendering compatibility

eslint.config.mjs


2. src/components/BusinessCard.tsx Formatting +0/-1

Remove inline ESLint suppression comment

• Removed inline eslint-disable-next-line @next/next/no-img-element comment
• Kept standard <img> tag for avatar rendering
• Code is now cleaner with global ESLint configuration handling the rule

src/components/BusinessCard.tsx


3. src/lib/cardRenderer.tsx Formatting +0/-1

Remove inline ESLint suppression comment

• Removed inline eslint-disable-next-line @next/next/no-img-element comment
• Maintained standard <img> tag for avatar rendering
• Relies on global ESLint configuration for rule suppression

src/lib/cardRenderer.tsx


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review bot commented Apr 3, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX Issues (0)

Grey Divider


Remediation recommended

1. Brittle ESLint file override 🐞 Bug ⚙ Maintainability
Description
The @next/next/no-img-element override is scoped to two hard-coded file paths, so if either file
is moved/renamed the override will stop applying and lint failures will reappear. This makes the
lint setup fragile to refactors of BusinessCard/cardRenderer while they still rely on raw
<img> tags.
Code

eslint.config.mjs[R8-13]

+  {
+    files: ["src/components/BusinessCard.tsx", "src/lib/cardRenderer.tsx"],
+    rules: {
+      "@next/next/no-img-element": "off",
+    },
+  },
Evidence
eslint.config.mjs disables @next/next/no-img-element only for exactly
src/components/BusinessCard.tsx and src/lib/cardRenderer.tsx. Those files now contain <img>
without inline suppression, so if a refactor changes their paths, the override will no longer match
and the rule will start firing again.

eslint.config.mjs[5-13]
src/components/BusinessCard.tsx[44-51]
src/lib/cardRenderer.tsx[278-301]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The ESLint override disables `@next/next/no-img-element` for two exact file paths. If these files are renamed/moved, the override will stop matching and lint warnings will return.

### Issue Context
These files intentionally use raw `<img>` tags (e.g., for `html-to-image` rendering), so the rule override should be resilient to future refactors.

### Fix Focus Areas
- eslint.config.mjs[8-13]

### Suggested fix
- Replace exact paths with a more refactor-friendly glob (e.g., `"**/BusinessCard.tsx"`, `"**/cardRenderer.tsx"`, or a narrowly-scoped directory glob if appropriate).
- Add a short comment explaining *why* the rule is disabled for these matches (so future maintainers don’t re-enable it or remove the override unintentionally).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

Warning

Rate limit exceeded

@is0692vs has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 41 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 21 minutes and 41 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b8e1314d-72cb-491b-88cb-964ad0019460

📥 Commits

Reviewing files that changed from the base of the PR and between 51083e6 and 46bbe54.

📒 Files selected for processing (1)
  • eslint.config.mjs
📝 Walkthrough

ウォークスルー

ESLint設定をリファクタリングし、インラインの抑止コメントをファイルレベルのコンフィグオーバーライドに移行しました。src/components/BusinessCard.tsxsrc/lib/cardRenderer.tsx@next/next/no-img-elementルール抑止を、eslint.config.mjsで一元管理するように変更しました。

変更内容

コホート / ファイル 概要
ESLint設定集約
eslint.config.mjs
src/components/BusinessCard.tsxsrc/lib/cardRenderer.tsxを対象とした@next/next/no-img-elementルール無効化オーバーライドを追加
インラインコメント削除
src/components/BusinessCard.tsx, src/lib/cardRenderer.tsx
個別ファイルのインラインESLint抑止コメント(@next/next/no-img-element)を削除し、設定ファイルでの統一管理に変更

推定レビュー作業量

🎯 1 (Trivial) | ⏱️ ~3分

ラビットの詩

🐰✨ インラインのコメントを片付けて、
設定ファイルへと整理したよ。
<img>たちは自由に画像を映し、
ルールはまとめて一カ所で、
すっきり整ったコードになったね!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed タイトルはESLintの設定変更と、BusinessCardコンポーネントのimg要素に関するルール無効化という実際の変更内容を正確に反映しており、簡潔で明確です。
Description check ✅ Passed 説明は変更内容(eslint.config.mjsの更新とインラインコメント削除)、理由(html-to-imageエンジンの互換性)、検証方法(ESLint、テスト、ビルド実行)に関連しており、充実した情報を提供しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/business-card-eslint-img-tags-5884096278838244657

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request centralizes the ESLint configuration by moving the '@next/next/no-img-element' rule override from inline comments to the global configuration file for specific components. Feedback suggests extending this override to include the OG image route to ensure consistency across the codebase where standard img tags are required.

...nextVitals,
...nextTs,
{
files: ["src/components/BusinessCard.tsx", "src/lib/cardRenderer.tsx"],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The src/app/api/og/[username]/route.tsx file also utilizes standard <img> tags for dynamic image generation (via ImageResponse). To ensure consistency across the project and prevent potential linting errors in similar image-rendering contexts, it should be included in this override list.

Suggested change
files: ["src/components/BusinessCard.tsx", "src/lib/cardRenderer.tsx"],
files: ["src/components/BusinessCard.tsx", "src/lib/cardRenderer.tsx", "src/app/api/og/[username]/route.tsx"],

@is0692vs
Copy link
Copy Markdown
Contributor Author

Closing as stale/superseded: this lint cleanup branch now conflicts with current main and overlaps with later card-rendering refactors.

@is0692vs is0692vs closed this Apr 12, 2026
@google-labs-jules
Copy link
Copy Markdown
Contributor

Closing as stale/superseded: this lint cleanup branch now conflicts with current main and overlaps with later card-rendering refactors.

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant