From 57ea79828f25f3b1141feda4601ec96e834402ac Mon Sep 17 00:00:00 2001 From: Josh Cunningham Date: Wed, 28 Feb 2024 10:24:43 -0800 Subject: [PATCH] chore: align tsconfig with other projects --- src/utils/config.spec.ts | 2 +- src/utils/config.ts | 2 +- src/utils/date.spec.ts | 2 +- src/utils/index.spec.ts | 2 +- src/utils/money.spec.ts | 2 +- src/utils/transaction.spec.ts | 4 ++-- tsconfig.json | 34 ++++++++++++++++++++++++++-------- 7 files changed, 33 insertions(+), 15 deletions(-) diff --git a/src/utils/config.spec.ts b/src/utils/config.spec.ts index 4889903..855d937 100644 --- a/src/utils/config.spec.ts +++ b/src/utils/config.spec.ts @@ -1,6 +1,6 @@ import { readFileSync } from "fs"; -import { Configuration, getConfiguration } from "./config"; +import { Configuration, getConfiguration } from "./config.js"; jest.mock("fs", () => ({ readFileSync: jest.fn(), diff --git a/src/utils/config.ts b/src/utils/config.ts index e15d16b..5d136f6 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -1,4 +1,4 @@ -import path from "path"; +import * as path from "path"; import { readFileSync } from "fs"; import { CommandArgs } from "../cli.js"; import { getReportYear } from "./date.js"; diff --git a/src/utils/date.spec.ts b/src/utils/date.spec.ts index 9300a98..2017fb4 100644 --- a/src/utils/date.spec.ts +++ b/src/utils/date.spec.ts @@ -1,4 +1,4 @@ -import { getFormattedDate, getReportYear } from "./date"; +import { getFormattedDate, getReportYear } from "./date.js"; describe("Function: getFormattedDate", () => { it("returns the correctly formatted date", () => { diff --git a/src/utils/index.spec.ts b/src/utils/index.spec.ts index d3e3865..10ff032 100644 --- a/src/utils/index.spec.ts +++ b/src/utils/index.spec.ts @@ -1,4 +1,4 @@ -import { padLeftZero } from "./"; +import { padLeftZero } from "./index.js"; describe("Function: padLeftZero", () => { it("pads a single digit with a zero", () => { diff --git a/src/utils/money.spec.ts b/src/utils/money.spec.ts index 933efd6..966a959 100644 --- a/src/utils/money.spec.ts +++ b/src/utils/money.spec.ts @@ -2,7 +2,7 @@ import { convertStringCurrencyToNumber, roundCurrency, formatCurrency, -} from "./money"; +} from "./money.js"; describe("Function: convertStringCurrencyToNumber", () => { it("handles dollar signs", () => { diff --git a/src/utils/transaction.spec.ts b/src/utils/transaction.spec.ts index d06563e..aa00c6b 100644 --- a/src/utils/transaction.spec.ts +++ b/src/utils/transaction.spec.ts @@ -1,5 +1,5 @@ -import { AutoCategorization, Configuration, getConfiguration } from "./config"; -import { TransactionImported, autoCategorize } from "./transaction"; +import { AutoCategorization, Configuration, getConfiguration } from "./config.js"; +import { TransactionImported, autoCategorize } from "./transaction.js"; describe("Function: autoCategorize", () => { let mockTransaction: TransactionImported; diff --git a/tsconfig.json b/tsconfig.json index ee6f852..4c489fe 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,16 +5,34 @@ "jest.config.ts" ], "compilerOptions": { - "noImplicitReturns": true, - "noImplicitAny": true, - "removeComments": true, - "target": "es2022", - "module": "es2022", + "strict": true, "outDir": "./dist", + "target": "es2022", + "module": "nodenext", "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "strict": true, "skipLibCheck": true, - "moduleResolution": "node" + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "isolatedModules": true, + "newLine": "lf", + "useDefineForClassFields": true, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noEmitOnError": true, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "forceConsistentCasingInFileNames": true, + }, + "ts-node": { + "esm": true, + "transpileOnly": true, + "files": true, + "experimentalResolver": true } } \ No newline at end of file