From 658c523e9c8cb25c5d8b52cdbab5da84aa8f8a8b Mon Sep 17 00:00:00 2001 From: Joscha Date: Thu, 3 Aug 2023 14:32:49 +0200 Subject: [PATCH] Set up typescript project --- .vscode/settings.json | 4 ++++ static/main.ts | 5 +++++ tsconfig.json | 23 +++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 static/main.ts create mode 100644 tsconfig.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e413016 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "json.format.keepLines": true, + "typescript.format.semicolons": "insert", +} diff --git a/static/main.ts b/static/main.ts new file mode 100644 index 0000000..fa740c4 --- /dev/null +++ b/static/main.ts @@ -0,0 +1,5 @@ +function main() { + alert("Hello world!"); +} + +main(); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..ab457ee --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,23 @@ +{ // See also https://aka.ms/tsconfig + "include": [ "static/**/*" ], + + "compilerOptions": { + "target": "ES2015", + "module": "ES2015", + "rootDir": "static", + "outDir": "target/static", + + // Misc + // TODO Source maps? + "forceConsistentCasingInFileNames": true, + "newLine": "lf", + "removeComments": true, + + // Type checking + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noUncheckedIndexedAccess": true, + "strict": true, + } +}