Skip to content

Commit 20162f6

Browse files
authored
chore: use lint tags (#2952)
1 parent f8d390e commit 20162f6

File tree

8 files changed

+14
-2
lines changed

8 files changed

+14
-2
lines changed

deno.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
},
8181
"lint": {
8282
"rules": {
83+
"tags": ["recommended", "fresh", "jsr", "jsx", "react"],
8384
"exclude": ["no-window"],
8485
"include": ["no-console"]
8586
}

src/dev/middlewares/error_overlay/overlay.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ export function ErrorOverlay(props: { url: URL }) {
131131
return (
132132
<>
133133
<div class="frsh-error-page">
134-
<style dangerouslySetInnerHTML={{ __html: errorCss }} />
134+
<style
135+
// deno-lint-ignore react-no-danger
136+
dangerouslySetInnerHTML={{ __html: errorCss }}
137+
/>
135138
<div class="inner">
136139
<div class="header">
137140
<button
@@ -163,6 +166,7 @@ export function ErrorOverlay(props: { url: URL }) {
163166
</div>
164167
</div>
165168
<script
169+
// deno-lint-ignore react-no-danger
166170
dangerouslySetInnerHTML={{
167171
__html:
168172
`document.querySelector("#close-btn").addEventListener("click", () => parent.postMessage("close-error-overlay"));`,

src/runtime/server/preact_hooks.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ function FreshRuntimeScript() {
452452
<script
453453
id={`__FRSH_STATE_${partialId}`}
454454
type="application/json"
455+
// deno-lint-ignore react-no-danger
455456
dangerouslySetInnerHTML={{ __html: JSON.stringify(json) }}
456457
/>
457458
);
@@ -486,6 +487,7 @@ function FreshRuntimeScript() {
486487
<script
487488
type="module"
488489
nonce={nonce}
490+
// deno-lint-ignore react-no-danger
489491
dangerouslySetInnerHTML={{
490492
__html: scriptContent,
491493
}}

www/components/CodeBlock.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export function CodeBlock(
77
<pre
88
class="rounded-lg text-base leading-relaxed bg-slate-800 text-white p-4 sm:p-6 md:p-4 lg:p-6 2xl:p-8 overflow-x-auto"
99
data-language={lang}
10+
// deno-lint-ignore react-no-danger
1011
><code dangerouslySetInnerHTML={{ __html: Prism.highlight(code, Prism.languages[lang], lang)}} /></pre>
1112
);
1213
}

www/islands/TableOfContents.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export function TableOfContents({ headings }: TableOfContentsProps) {
128128
<a
129129
href={`#${heading.id}`}
130130
class="block truncatetext-gray-600"
131+
// deno-lint-ignore react-no-danger
131132
dangerouslySetInnerHTML={{ __html: heading.html }}
132133
/>
133134
</li>
@@ -166,6 +167,7 @@ export function TableOfContents({ headings }: TableOfContentsProps) {
166167
heading.id,
167168
);
168169
}}
170+
// deno-lint-ignore react-no-danger
169171
dangerouslySetInnerHTML={{ __html: heading.html }}
170172
/>
171173
</li>

www/routes/_app.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export default define.page(function App({ Component, state, url }) {
4545
: null}
4646
<script
4747
type="module"
48+
// deno-lint-ignore react-no-danger
4849
dangerouslySetInnerHTML={{
4950
__html: `
5051
const isDarkMode = localStorage.theme === "dark"

www/routes/docs/[...slug].tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ export default define.page<typeof handler>(function DocsPage(props) {
204204
</h1>
205205
<div
206206
class="markdown-body mb-8"
207+
// deno-lint-ignore react-no-danger
207208
dangerouslySetInnerHTML={{ __html: html }}
208209
/>
209210

www/routes/docs/_layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PageProps } from "../../../src/context.ts";
1+
import type { PageProps } from "../../../src/context.ts";
22

33
export default function Layout({ Component }: PageProps) {
44
return (

0 commit comments

Comments
 (0)