Skip to content

Fix deno lint react-no-danger failures by using proper lint-ignore directive syntax#3

Merged
daesdev merged 5 commits intomainfrom
copilot/deno-lint-ignore-dangerous-types
Apr 5, 2026
Merged

Fix deno lint react-no-danger failures by using proper lint-ignore directive syntax#3
daesdev merged 5 commits intomainfrom
copilot/deno-lint-ignore-dangerous-types

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 5, 2026

deno lint was failing on all dangerouslySetInnerHTML usages because {/* deno-lint-ignore react-no-danger */} JSX expression comments are not recognized as lint directives — only // deno-lint-ignore JavaScript comments are.

Changes

  • components/Footer.tsx, routes/index.tsx, routes/[lang]/index.tsx: Replaced JSX-style ignore comments with inline JS comments placed between JSX attributes, directly before dangerouslySetInnerHTML

Before:

{/* deno-lint-ignore react-no-danger */}
<div dangerouslySetInnerHTML={{ __html: content }}>

After:

<div
  // deno-lint-ignore react-no-danger
  dangerouslySetInnerHTML={{ __html: content }}
>

Placing // deno-lint-ignore between JSX attributes is valid TSX syntax and is the only form Deno lint recognizes as a suppression directive.

Copilot AI changed the title [WIP] Update dangerous types with deno lint ignore Fix deno lint react-no-danger failures by using proper lint-ignore directive syntax Apr 5, 2026
Copilot AI requested a review from daesdev April 5, 2026 13:10
@daesdev daesdev requested a review from Copilot April 5, 2026 14:04
@daesdev daesdev marked this pull request as ready for review April 5, 2026 14:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes deno lint failures for react-no-danger by converting JSX expression comments into valid // deno-lint-ignore directives placed inside TSX attribute lists.

Changes:

  • Updated dangerouslySetInnerHTML lint suppressions to use // deno-lint-ignore react-no-danger in TSX.
  • Tightened Fresh handler/page typing in the index routes to use explicit Data + middleware state generics.
  • Corrected _404 route to import/use PageProps (capitalized) from $fresh/server.ts.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
routes/index.tsx Replaces invalid JSX lint-ignore comment with valid directive; adds explicit Handlers/PageProps generics.
routes/[lang]/index.tsx Same lint directive fix as root index; adds explicit Handlers/PageProps generics.
components/Footer.tsx Updates lint suppressions for dangerouslySetInnerHTML; simplifies props typing.
routes/_404.tsx Fixes Fresh PageProps import/type casing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1 to +3
import { Head } from "$fresh/runtime.ts";
import { pageProps } from "$fresh/server.ts";
export default function Error404(_props: pageProps<{ message: string }>) {
import { PageProps } from "$fresh/server.ts";
export default function Error404(_props: PageProps<{ message: string }>) {
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

This file’s change (fixing the $fresh/server.ts type import from pageProps to PageProps) is unrelated to the PR’s stated goal of fixing react-no-danger lint suppressions. Please either update the PR description to mention this additional fix, or split it into a separate PR to keep the scope focused.

Copilot uses AI. Check for mistakes.
@daesdev daesdev merged commit 2ab88d3 into main Apr 5, 2026
5 of 6 checks passed
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.

3 participants