From e0c5ddc2ffa6cc8a9924bf66368778451bc49c68 Mon Sep 17 00:00:00 2001 From: Clarence Chan Date: Tue, 28 Jan 2025 22:33:56 -0500 Subject: [PATCH] Add typescript dev dependency --- package-lock.json | 17 ++++++++++++++++- package.json | 5 +++-- src/index.ts | 2 +- src/{types.ts => types.d.ts} | 0 tsconfig.json | 18 ++++++++++++++++++ 5 files changed, 38 insertions(+), 4 deletions(-) rename src/{types.ts => types.d.ts} (100%) create mode 100644 tsconfig.json diff --git a/package-lock.json b/package-lock.json index e71a2504..df7c00a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,8 @@ "html-entities": "^2.4.0", "ics": "^3.4.0", "node-html-parser": "^6.1.9", - "tsx": "^4.19.2" + "tsx": "^4.19.2", + "typescript": "^5.7.3" } }, "node_modules/@esbuild/aix-ppc64": { @@ -738,6 +739,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typescript": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/undici-types": { "version": "6.20.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", diff --git a/package.json b/package.json index b0d084a5..247a0fa6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "ufc-cal", "version": "1.0.0", "description": "", - "main": "index.js", + "main": "src/index.ts", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "npx tsx src/index.ts" @@ -14,7 +14,8 @@ "html-entities": "^2.4.0", "ics": "^3.4.0", "node-html-parser": "^6.1.9", - "tsx": "^4.19.2" + "tsx": "^4.19.2", + "typescript": "^5.7.3" }, "type": "module" } diff --git a/src/index.ts b/src/index.ts index b5a60d3e..8e7660f3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ import { getAllDetailedEvents } from "./scrape.js"; import * as fs from "fs"; -import { createEvents, DateArray, EventAttributes } from "ics"; +import { createEvents, type DateArray, type EventAttributes } from "ics"; /** * Extracts the details of recent and upcoming UFC events, then creates an diff --git a/src/types.ts b/src/types.d.ts similarity index 100% rename from src/types.ts rename to src/types.d.ts diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..655b76e4 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "esModuleInterop": true, + "skipLibCheck": true, + "target": "es2022", + "allowJs": true, + "resolveJsonModule": true, + "moduleDetection": "force", + "isolatedModules": true, + "verbatimModuleSyntax": true, + "strict": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, + "module": "preserve", + "noEmit": true, + "lib": ["es2022"] + } +}