Skip to content

Commit

Permalink
Updated the example of with-eslint to utilize the App Router. (vercel…
Browse files Browse the repository at this point in the history
…#70018)

This PR updates the with-eslint example for using the App Router. 
Here are the changes that have been made:

- Renamed the "pages" folder to the "app" folder.
- Added the layout.tsx file as part of the App Router.
- Updated the package.json file.
- Updated tsconfig.json file

CC: @samcx

---------

Co-authored-by: samcx <[email protected]>
  • Loading branch information
PapatMayuri and samcx authored Sep 12, 2024
1 parent 7b95c63 commit fbe6c37
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 12 deletions.
18 changes: 18 additions & 0 deletions examples/with-eslint/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
8 changes: 8 additions & 0 deletions examples/with-eslint/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default function Home() {
return (
<div>
<script src="https://fake-script.com" />
<p>Home</p>
</div>
);
}
11 changes: 7 additions & 4 deletions examples/with-eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{
"private": true,
"scripts": {
"dev": "next",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "latest",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"eslint": "^7.24.0",
"@types/node": "^22.5.4",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"eslint": "^8.57.0",
"eslint-config-next": "latest"
}
}
8 changes: 0 additions & 8 deletions examples/with-eslint/pages/index.js

This file was deleted.

27 changes: 27 additions & 0 deletions examples/with-eslint/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}

0 comments on commit fbe6c37

Please sign in to comment.