File tree Expand file tree Collapse file tree 4 files changed +32
-27
lines changed
Expand file tree Collapse file tree 4 files changed +32
-27
lines changed Original file line number Diff line number Diff line change 1- import { dirname } from "path" ;
2- import { fileURLToPath } from "url" ;
3- import { FlatCompat } from "@eslint/eslintrc" ;
4-
5- const __filename = fileURLToPath ( import . meta. url ) ;
6- const __dirname = dirname ( __filename ) ;
7-
8- const compat = new FlatCompat ( {
9- baseDirectory : __dirname ,
10- } ) ;
1+ import nextCoreWebVitals from "eslint-config-next/core-web-vitals" ;
2+ import nextTypescript from "eslint-config-next/typescript" ;
113
124const eslintConfig = [
13- ...compat . extends ( "next/core-web-vitals" , "next/typescript" ) ,
5+ ...nextCoreWebVitals ,
6+ ...nextTypescript ,
7+ {
8+ ignores : [
9+ "node_modules/**" ,
10+ ".next/**" ,
11+ "out/**" ,
12+ "build/**" ,
13+ "next-env.d.ts" ,
14+ ] ,
15+ } ,
1416] ;
1517
1618export default eslintConfig ;
Original file line number Diff line number Diff line change 1010 "dev" : " next dev --turbopack" ,
1111 "build" : " next build" ,
1212 "start" : " next start" ,
13- "lint" : " next lint "
13+ "lint" : " eslint . "
1414 },
1515 "dependencies" : {
1616 "@fortedigital/nextjs-cache-handler" : " workspace:*" ,
2020 "redis" : " ^5.10.0"
2121 },
2222 "devDependencies" : {
23- "@eslint/eslintrc" : " ^3" ,
2423 "@tailwindcss/postcss" : " ^4" ,
2524 "@types/node" : " ^24" ,
2625 "@types/react" : " 19.2.6" ,
Original file line number Diff line number Diff line change 11export default async function Home ( ) {
2+ let name : string ;
23 try {
34 const characterResponse = await fetch (
45 "https://api.sampleapis.com/futurama/characters/1" ,
@@ -10,13 +11,7 @@ export default async function Home() {
1011 }
1112 ) ;
1213 const character = await characterResponse . json ( ) ;
13- const name = character . name . first ;
14- return (
15- < div >
16- < h1 > Name: { name } </ h1 >
17- < span > { new Date ( ) . toISOString ( ) } </ span >
18- </ div >
19- ) ;
14+ name = character . name . first ;
2015 } catch ( error ) {
2116 console . error ( "Error fetching character data:" , error ) ;
2217 return (
@@ -25,4 +20,11 @@ export default async function Home() {
2520 </ div >
2621 ) ;
2722 }
23+
24+ return (
25+ < div >
26+ < h1 > Name: { name } </ h1 >
27+ < span > { new Date ( ) . toISOString ( ) } </ span >
28+ </ div >
29+ ) ;
2830}
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ export async function Example({
44 searchParams : Promise < { characterId : string } > ;
55} ) {
66 const characterId = ( await searchParams ) . characterId ;
7+ let name : string ;
78 try {
89 const characterResponse = await fetch (
910 `https://api.sampleapis.com/futurama/characters/${ characterId } ` ,
@@ -15,13 +16,7 @@ export async function Example({
1516 }
1617 ) ;
1718 const character = await characterResponse . json ( ) ;
18- const name = character . name . first ;
19- return (
20- < div >
21- < h1 > Name: { name } </ h1 >
22- < span > { new Date ( ) . toISOString ( ) } </ span >
23- </ div >
24- ) ;
19+ name = character . name . first ;
2520 } catch ( error ) {
2621 console . error ( "Error fetching character data:" , error ) ;
2722 return (
@@ -30,6 +25,13 @@ export async function Example({
3025 </ div >
3126 ) ;
3227 }
28+
29+ return (
30+ < div >
31+ < h1 > Name: { name } </ h1 >
32+ < span > { new Date ( ) . toISOString ( ) } </ span >
33+ </ div >
34+ ) ;
3335}
3436
3537export async function Skeleton ( ) {
You can’t perform that action at this time.
0 commit comments