From 0a3de9ee7366de87d46a4bcf10bfb7f1ad1b8ec5 Mon Sep 17 00:00:00 2001 From: Junhao Liao Date: Sat, 11 Jan 2025 19:39:57 -0500 Subject: [PATCH] Update TypeScript configs with stricter linting. --- .../log-viewer-webui/client/tsconfig.app.json | 28 +++++++++++-------- .../log-viewer-webui/client/tsconfig.json | 8 ++++-- .../client/tsconfig.node.json | 21 ++++++++------ 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/components/log-viewer-webui/client/tsconfig.app.json b/components/log-viewer-webui/client/tsconfig.app.json index d31f6c33c..c3f44a158 100644 --- a/components/log-viewer-webui/client/tsconfig.app.json +++ b/components/log-viewer-webui/client/tsconfig.app.json @@ -1,21 +1,26 @@ { "compilerOptions": { - "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", - "target": "ES2020", - "useDefineForClassFields": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], + "lib": [ + "ES2022", + "DOM", + "DOM.Iterable" + ], "module": "ESNext", "skipLibCheck": true, + "target": "ES2022", + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "useDefineForClassFields": true, /* Bundler mode */ - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, "isolatedModules": true, + "jsx": "react-jsx", "moduleDetection": "force", + "moduleResolution": "bundler", "noEmit": true, - "jsx": "react-jsx", /* Linting */ + "allowUnreachableCode": false, + "allowUnusedLabels": false, "alwaysStrict": true, "exactOptionalPropertyTypes": true, "noFallthroughCasesInSwitch": true, @@ -23,16 +28,15 @@ "noImplicitOverride": true, "noImplicitReturns": true, "noImplicitThis": true, + "noPropertyAccessFromIndexSignature": true, "noUncheckedIndexedAccess": true, "noUncheckedSideEffectImports": true, "noUnusedLocals": true, "noUnusedParameters": true, "strict": true, - "strictBindCallApply": true, - "strictFunctionTypes": true, - "strictNullChecks": true, - "strictPropertyInitialization": true, "useUnknownInCatchVariables": true }, - "include": ["src"] + "include": [ + "src" + ] } diff --git a/components/log-viewer-webui/client/tsconfig.json b/components/log-viewer-webui/client/tsconfig.json index 1ffef600d..ea9d0cd82 100644 --- a/components/log-viewer-webui/client/tsconfig.json +++ b/components/log-viewer-webui/client/tsconfig.json @@ -1,7 +1,11 @@ { "files": [], "references": [ - { "path": "./tsconfig.app.json" }, - { "path": "./tsconfig.node.json" } + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.node.json" + } ] } diff --git a/components/log-viewer-webui/client/tsconfig.node.json b/components/log-viewer-webui/client/tsconfig.node.json index b96070702..63a252a36 100644 --- a/components/log-viewer-webui/client/tsconfig.node.json +++ b/components/log-viewer-webui/client/tsconfig.node.json @@ -1,19 +1,23 @@ { "compilerOptions": { - "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", - "target": "ES2022", - "lib": ["ES2023"], + "lib": [ + "ES2023" + ], "module": "ESNext", "skipLibCheck": true, + "target": "ES2022", + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", /* Bundler mode */ - "moduleResolution": "bundler", "allowImportingTsExtensions": true, "isolatedModules": true, "moduleDetection": "force", + "moduleResolution": "bundler", "noEmit": true, /* Linting */ + "allowUnreachableCode": false, + "allowUnusedLabels": false, "alwaysStrict": true, "exactOptionalPropertyTypes": true, "noFallthroughCasesInSwitch": true, @@ -21,16 +25,15 @@ "noImplicitOverride": true, "noImplicitReturns": true, "noImplicitThis": true, + "noPropertyAccessFromIndexSignature": true, "noUncheckedIndexedAccess": true, "noUncheckedSideEffectImports": true, "noUnusedLocals": true, "noUnusedParameters": true, "strict": true, - "strictBindCallApply": true, - "strictFunctionTypes": true, - "strictNullChecks": true, - "strictPropertyInitialization": true, "useUnknownInCatchVariables": true }, - "include": ["vite.config.ts"] + "include": [ + "vite.config.ts" + ] }