From 08c4990dc9ab6950060de95031983dcffd184f43 Mon Sep 17 00:00:00 2001 From: Majorfi Date: Wed, 15 Nov 2023 12:54:24 +0100 Subject: [PATCH] chores: add pre-commit hook to catch ts errors --- .lintstagedrc.json | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 913b73c8e..f5959cc7b 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,4 +1,4 @@ { - "*.ts|*.tsx": ["yarn prettier-format", "eslint"], + "*.ts|*.tsx": ["yarn prettier-format", "yarn eslint --quiet --fix", "bash -c tsc --noEmit"], "*.scss|*.css": "yarn prettier-format" } diff --git a/package.json b/package.json index 1b6ae4337..df633e9ec 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "lint": "eslint . --ext .js,.jsx,.ts,.tsx", "prettier": "prettier --check \"./**/**/*.{json,js,ts,tsx,scss}\"", "prettier-format": "prettier --config .prettierrc \"./**/**/*.{json,js,ts,tsx,scss,md}\" --write", + "tslint": "tsc -p tsconfig.json --noEmit", "bump": "bump", "prepare": "husky install", "test": "vitest run"