Skip to content

Commit 2ab88d3

Browse files
authored
Merge pull request #3 from daesdev/copilot/deno-lint-ignore-dangerous-types
2 parents 39db790 + e1a82cb commit 2ab88d3

4 files changed

Lines changed: 32 additions & 23 deletions

File tree

components/Footer.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
import { PageProps } from "$fresh/server.ts";
21
import translations from "../locales/es.json" with { type: "json" };
3-
interface State {
2+
3+
interface FooterProps {
44
state: { lang: string; translations: typeof translations };
55
}
6-
export default function Footer({ state }: PageProps<State>) {
6+
7+
export default function Footer({ state }: FooterProps) {
78
const { lang: _lang, translations } = state;
89
return (
910
<footer class="text-center text-xs w-full py-1 mt-10 mb-20">
10-
{/* deno-lint-ignore react-no-danger */}
1111
<div
1212
class="py-1"
13+
// deno-lint-ignore react-no-danger
1314
dangerouslySetInnerHTML={{
1415
__html: translations.index.footer.development,
1516
}}
1617
>
1718
</div>
18-
{/* deno-lint-ignore react-no-danger */}
1919
<div
2020
class="py-1"
21+
// deno-lint-ignore react-no-danger
2122
dangerouslySetInnerHTML={{
2223
__html: translations.index.footer.created,
2324
}}

routes/[lang]/index.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,23 @@ import AnchorLang from "../../islands/AnchorLang.tsx";
88
import translations from "../../locales/es.json" with { type: "json" };
99
import { getLanguages } from "../../utils/global.ts";
1010

11-
export const handler: Handlers = {
11+
interface MiddlewareState {
12+
lang: string;
13+
translations: typeof translations;
14+
}
15+
16+
interface Data {
17+
languages: string[];
18+
}
19+
20+
export const handler: Handlers<Data, MiddlewareState> = {
1221
async GET(_, ctx) {
1322
const languages = await getLanguages(); // Obtén los lenguajes en el servidor
1423
return ctx.render({ languages });
1524
},
1625
};
1726

18-
interface State {
19-
state: { lang: string; translations: typeof translations };
20-
languages: string[];
21-
}
22-
23-
export default function Home({ state, data }: PageProps<State>) {
27+
export default function Home({ state, data }: PageProps<Data, MiddlewareState>) {
2428
const { lang, translations } = state;
2529
const { languages } = data;
2630
return (
@@ -43,8 +47,8 @@ export default function Home({ state, data }: PageProps<State>) {
4347
<ul class="ml-6 list-disc col-span-full text-slate-800/90 dark:text-slate-200/80 text-pretty text-sm">
4448
{section.items.map((item, index) => (
4549
<li key={index}>
46-
{/* deno-lint-ignore react-no-danger */}
4750
<div
51+
// deno-lint-ignore react-no-danger
4852
dangerouslySetInnerHTML={{
4953
__html: item,
5054
}}

routes/_404.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Head } from "$fresh/runtime.ts";
2-
import { pageProps } from "$fresh/server.ts";
3-
export default function Error404(_props: pageProps<{ message: string }>) {
2+
import { PageProps } from "$fresh/server.ts";
3+
export default function Error404(_props: PageProps<{ message: string }>) {
44
return (
55
<>
66
<Head>

routes/index.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,23 @@ import AnchorLang from "../islands/AnchorLang.tsx";
77
import translations from "../locales/es.json" with { type: "json" };
88
import { getLanguages } from "../utils/global.ts";
99

10-
export const handler: Handlers = {
10+
interface MiddlewareState {
11+
lang: string;
12+
translations: typeof translations;
13+
}
14+
15+
interface Data {
16+
languages: string[];
17+
}
18+
19+
export const handler: Handlers<Data, MiddlewareState> = {
1120
async GET(_, ctx) {
1221
const languages = await getLanguages(); // Obtén los lenguajes en el servidor
1322
return ctx.render({ languages });
1423
},
1524
};
1625

17-
interface State {
18-
state: { lang: string; translations: typeof translations };
19-
languages: string[];
20-
}
21-
22-
export default function Home({ state, data }: PageProps<State>) {
26+
export default function Home({ state, data }: PageProps<Data, MiddlewareState>) {
2327
const { lang, translations } = state;
2428
const { languages } = data;
2529
return (
@@ -42,8 +46,8 @@ export default function Home({ state, data }: PageProps<State>) {
4246
<ul class="ml-6 list-disc col-span-full text-slate-800/90 dark:text-slate-200/80 text-pretty text-sm">
4347
{section.items.map((item, index) => (
4448
<li key={index}>
45-
{/* deno-lint-ignore react-no-danger */}
4649
<div
50+
// deno-lint-ignore react-no-danger
4751
dangerouslySetInnerHTML={{
4852
__html: item,
4953
}}

0 commit comments

Comments
 (0)