From a7512bd8518f83ba992f6a6761764f644f66551e Mon Sep 17 00:00:00 2001 From: Ohm Patel Date: Tue, 20 Feb 2024 05:38:34 -0500 Subject: [PATCH] Add pre-commit --- .eslintrc.cjs | 4 +-- .prettierrc | 2 +- package.json | 11 +++++-- src/app/layout.tsx | 5 ++- tsconfig.json | 68 ++++++++++++++++++++-------------------- types.d.ts | 8 ++--- yarn.lock | 77 +++++++++++++++++++++++++++++++++++++++++++++- 7 files changed, 127 insertions(+), 48 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index ad76ce2..44f2faa 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -31,10 +31,10 @@ module.exports = { { files: ["**/*.test.ts", "**/*.test.js"], env: { - "jest/globals": true + "jest/globals": true, }, plugins: ["jest"], extends: ["plugin:jest/recommended"], }, - ] + ], }; diff --git a/.prettierrc b/.prettierrc index 4266c09..457139c 100644 --- a/.prettierrc +++ b/.prettierrc @@ -5,4 +5,4 @@ "tabWidth": 2, "semi": true, "useTabs": true -} \ No newline at end of file +} diff --git a/package.json b/package.json index 50abbec..50f638a 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,11 @@ "author": "Ohm Patel ", "license": "GPL-3.0-or-later", "scripts": { - "dev": "next dev", + "dev": "next dev --turbo", "build": "next build", "start": "next start", "lint": "prettier -w ./__tests__ ./src && next lint --fix && eslint ./__tests__ --fix", - "lint:nofix": "prettier -l ./__tests__ ./src && next lint --quiet && eslint ./__tests__", + "lint:nofix": "(prettier -l ./__tests__ ./src && next lint --quiet 1>NUL: && eslint ./__tests__) || echo Linting failed view details above && exit 1", "test": "jest", "test:ci": "jest --ci --coverage" }, @@ -37,6 +37,7 @@ "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", "postcss": "^8.4.35", + "pre-commit": "^1.2.2", "prettier": "^3.2.5", "prettier-plugin-tailwindcss": "^0.5.11", "tailwindcss": "^3.4.1", @@ -45,5 +46,9 @@ "resolutions": { "wrap-ansi": "7.0.0", "string-width": "4.2.3" - } + }, + "pre-commit": [ + "lint:nofix", + "test:ci" + ] } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 3961d98..f8760e6 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -5,7 +5,6 @@ import Image from "next/image"; export const metadata: Metadata = { title: "CSC Librarian", description: "A simple library management system for UW CSC", - lang: "en", }; export default function RootLayout({ @@ -44,12 +43,12 @@ const navbar = (