From 0f8c06097e31aed57a9815423ad10e3a98473e8e Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Wed, 15 May 2024 18:44:49 +0530 Subject: [PATCH 1/3] Feat: Adding lint workflow --- .github/workflows/lint.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..2570fd4d --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,27 @@ +name: Lint, Format and Type check workflow + +on: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + linting_and_type-checking: + name: Linting, Formatting and Type checking + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Linting and Formatting checks + run: yarn run lint + + - name: Type checking + run: yarn run typecheck \ No newline at end of file From 338db6af912ad67d6edde9ec0274c76d16c2d2c5 Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Wed, 15 May 2024 21:57:49 +0530 Subject: [PATCH 2/3] adding husky --- .husky/_/husky.sh | 0 .husky/_/pre-commit | 8 ++++++++ package.json | 23 +++++++++++++---------- 3 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 .husky/_/husky.sh create mode 100755 .husky/_/pre-commit diff --git a/.husky/_/husky.sh b/.husky/_/husky.sh new file mode 100644 index 00000000..e69de29b diff --git a/.husky/_/pre-commit b/.husky/_/pre-commit new file mode 100755 index 00000000..4f0237ad --- /dev/null +++ b/.husky/_/pre-commit @@ -0,0 +1,8 @@ +#!/bin/sh +. "$(dirname "$0")/husky.sh" + +echo 'Performing code styling, testing, and building processes before committing' + +yarn run lint && yarn run typecheck + +echo 'The code appears to meet the required standards. Proceeding with the build process.' \ No newline at end of file diff --git a/package.json b/package.json index a194f4b1..e92ab557 100644 --- a/package.json +++ b/package.json @@ -5,17 +5,20 @@ "build": "turbo build", "dev": "turbo dev", "lint": "turbo lint", - "format": "prettier --write \"**/*.{ts,tsx,md}\"" - }, - "devDependencies": { - "@repo/eslint-config": "*", - "@repo/typescript-config": "*", - "prettier": "^3.2.5", - "turbo": "latest" - }, - "engines": { - "node": ">=18" + "format": "prettier --write \"**/*.{ts,tsx,md}\"", + "typecheck": "tsc --pretty --noEmit", + "prepare": "husky" }, + "devDependencies": { + "@repo/eslint-config": "*", + "@repo/typescript-config": "*", + "husky": "^9.0.11", + "prettier": "^3.2.5", + "turbo": "latest" + }, + "engines": { + "node": ">=18" + }, "packageManager": "yarn@1.22.21", "workspaces": [ "apps/*", From 709599127aa52ead96b32fcf0b150d17076c8b8f Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <124715224+DhairyaMajmudar@users.noreply.github.com> Date: Wed, 15 May 2024 22:02:08 +0530 Subject: [PATCH 3/3] Update pre-commit --- .husky/_/pre-commit | 2 -- 1 file changed, 2 deletions(-) diff --git a/.husky/_/pre-commit b/.husky/_/pre-commit index 4f0237ad..4f1f1e8d 100755 --- a/.husky/_/pre-commit +++ b/.husky/_/pre-commit @@ -4,5 +4,3 @@ echo 'Performing code styling, testing, and building processes before committing' yarn run lint && yarn run typecheck - -echo 'The code appears to meet the required standards. Proceeding with the build process.' \ No newline at end of file