From e4267b86562211271a5eea611f2f91fa58ec9521 Mon Sep 17 00:00:00 2001 From: Leo Singer Date: Tue, 25 Jun 2024 16:24:32 -0400 Subject: [PATCH] Run TypeScript in pre-commit hook This should help catch issues like https://github.com/nasa-gcn/architect-plugin-search/pull/43#discussion_r1653501101. --- .gitignore | 1 + lint-staged.config.mjs | 4 ++++ package.json | 4 ---- tsconfig.json | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 lint-staged.config.mjs diff --git a/.gitignore b/.gitignore index 3f7ea24..f302b17 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules *.js *.tgz +*.tsbuildinfo diff --git a/lint-staged.config.mjs b/lint-staged.config.mjs new file mode 100644 index 0000000..6433eb8 --- /dev/null +++ b/lint-staged.config.mjs @@ -0,0 +1,4 @@ +export default { + '*.(json|md|ts)': 'prettier --write', + '*.ts': ['eslint', () => 'tsc'], +} diff --git a/package.json b/package.json index 91b98f1..28bd809 100644 --- a/package.json +++ b/package.json @@ -85,9 +85,5 @@ "parserOptions": { "sourceType": "module" } - }, - "lint-staged": { - "*.(json|md|ts)": "prettier --write", - "*.ts": "eslint" } } diff --git a/tsconfig.json b/tsconfig.json index cad99b7..e6bca17 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,8 @@ { "extends": "@tsconfig/node14/tsconfig.json", "compilerOptions": { + "incremental": true, + "noEmit": true, "resolveJsonModule": true, "module": "esnext", "target": "es2022"