From 5fb118dd2321b54cb6ac8979d71f922e05dd925b Mon Sep 17 00:00:00 2001 From: christian-westerkam Date: Fri, 7 Nov 2025 22:42:03 +0100 Subject: [PATCH] Initial commit --- .gitignore | 17 +++++++++++++++++ package-lock.json | 26 ++++++++++++++++++++++++++ package.json | 5 +++++ src/hello.ts | 6 ++++++ tsconfig.json | 44 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 98 insertions(+) create mode 100644 .gitignore create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 src/hello.ts create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a588d18 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Dependencies +node_modules/ + +# Build output +dist/ +build/ + +# TypeScript cache +*.tsbuildinfo + +# Logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Environment variables +.env diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..50c32b6 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,26 @@ +{ + "name": "typescript-tutorial", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "devDependencies": { + "typescript": "^5.9.3" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..85cde15 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "devDependencies": { + "typescript": "^5.9.3" + } +} diff --git a/src/hello.ts b/src/hello.ts new file mode 100644 index 0000000..ae2a8f1 --- /dev/null +++ b/src/hello.ts @@ -0,0 +1,6 @@ +function greet(name: string): string { + return `Hello, ${name}!`; +} + +const message: string = greet("Christian"); +console.log(message); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..cec4a3a --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,44 @@ +{ + // Visit https://aka.ms/tsconfig to read more about this file + "compilerOptions": { + // File Layout + // "rootDir": "./src", + // "outDir": "./dist", + + // Environment Settings + // See also https://aka.ms/tsconfig/module + "module": "nodenext", + "target": "esnext", + "types": [], + // For nodejs: + // "lib": ["esnext"], + // "types": ["node"], + // and npm install -D @types/node + + // Other Outputs + "sourceMap": true, + "declaration": true, + "declarationMap": true, + + // Stricter Typechecking Options + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + + // Style Options + // "noImplicitReturns": true, + // "noImplicitOverride": true, + // "noUnusedLocals": true, + // "noUnusedParameters": true, + // "noFallthroughCasesInSwitch": true, + // "noPropertyAccessFromIndexSignature": true, + + // Recommended Options + "strict": true, + "jsx": "react-jsx", + "verbatimModuleSyntax": true, + "isolatedModules": true, + "noUncheckedSideEffectImports": true, + "moduleDetection": "force", + "skipLibCheck": true, + } +}