Skip to content

Commit

Permalink
Adding linter and github workflows (DiceDB#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucifercr07 authored Sep 28, 2024
1 parent 5afaea3 commit e54d64f
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["next/core-web-vitals", "next/typescript"]
"extends": ["next/core-web-vitals", "next/typescript", "eslint:recommended"]
}
37 changes: 37 additions & 0 deletions .github/workflows/nextjs-lint-build.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 2 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
14 changes: 1 addition & 13 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -26,7 +15,6 @@ export default function RootLayout({
return (
<html lang="en">
<body
// className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
</body>
Expand Down

0 comments on commit e54d64f

Please sign in to comment.