diff --git a/.eslintrc.json b/.eslintrc.json index 3722418..7e4e2ca 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": ["next/core-web-vitals", "next/typescript"] + "extends": ["next/core-web-vitals", "next/typescript", "eslint:recommended"] } diff --git a/.github/workflows/nextjs-lint-build.yml b/.github/workflows/nextjs-lint-build.yml new file mode 100644 index 0000000..24df56f --- /dev/null +++ b/.github/workflows/nextjs-lint-build.yml @@ -0,0 +1,37 @@ +name: NextJS Lint and Build + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + lint-and-build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + cache: 'npm' # Cache npm dependencies + + - name: Install dependencies + run: npm install + + - name: Run ESLint + run: npm run lint + + - name: Build the project + run: npm run build + + - name: TypeScript type check + if: always() && fileExists('tsconfig.json') + run: npm run type-check +g \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 427f053..0aa5c45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,8 +16,8 @@ "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", - "eslint": "^8", - "eslint-config-next": "14.2.13", + "eslint": "^8.57.1", + "eslint-config-next": "^14.2.13", "postcss": "^8", "tailwindcss": "^3.4.1", "typescript": "^5" @@ -1726,7 +1726,6 @@ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -1782,7 +1781,6 @@ "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-14.2.13.tgz", "integrity": "sha512-aro1EKAoyYchnO/3Tlo91hnNBO7QO7qnv/79MAFC+4Jq8TdUVKQlht5d2F+YjrePjdpOvfL+mV9JPfyYNwkk1g==", "dev": true, - "license": "MIT", "dependencies": { "@next/eslint-plugin-next": "14.2.13", "@rushstack/eslint-patch": "^1.3.3", diff --git a/package.json b/package.json index 86e0b45..5a1f8a1 100644 --- a/package.json +++ b/package.json @@ -6,21 +6,22 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "eslint . --ext js,jsx,ts,tsx", + "type-check": "tsc --noEmit" }, "dependencies": { + "next": "14.2.13", "react": "^18", - "react-dom": "^18", - "next": "14.2.13" + "react-dom": "^18" }, "devDependencies": { - "typescript": "^5", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", + "eslint": "^8.57.1", + "eslint-config-next": "^14.2.13", "postcss": "^8", "tailwindcss": "^3.4.1", - "eslint": "^8", - "eslint-config-next": "14.2.13" + "typescript": "^5" } } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 8d9b887..fd80ef3 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,17 +1,6 @@ import type { Metadata } from "next"; -// import localFont from "next/font/local"; import "@/styles/globals.css"; - -// const geistSans = localFont({ -// src: "./fonts/GeistVF.woff", -// variable: "--font-geist-sans", -// weight: "100 900", -// }); -// const geistMono = localFont({ -// src: "./fonts/GeistMonoVF.woff", -// variable: "--font-geist-mono", -// weight: "100 900", -// }); +import React from "react"; export const metadata: Metadata = { title: "Create Next App", @@ -26,7 +15,6 @@ export default function RootLayout({ return ( {children}