From 6b2f16ae9dcf536142659a9d5a4fb0dd42aab125 Mon Sep 17 00:00:00 2001 From: Jack Westbrook Date: Wed, 6 Mar 2024 14:38:54 +0100 Subject: [PATCH] build(typescript): adjust config for typechecking --- tsconfig.json | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index cb00b4c43b2..fe5c81df9e3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ES2020", "useDefineForClassFields": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], + "lib": ["ES2022", "DOM", "DOM.Iterable"], "module": "ESNext", "skipLibCheck": true, @@ -12,13 +12,14 @@ "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, - "jsx": "react-jsx", + // Todo: standard vite config uses react-jsx but it causes typechecks to fail + "jsx": "react", /* Linting */ "strict": true, - // "noUnusedLocals": true, // Disabled because of React being imported everywhere - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, + // "noUnusedLocals": true, // Standard vite config but disabled because of typecheck errors + // "noUnusedParameters": true, // Standard vite config but disabled because typecheck errors + // "noFallthroughCasesInSwitch": true, // Standard vite config but disabled because of typecheck errors "baseUrl": "public/", "outDir": "public/dist", @@ -31,9 +32,7 @@ "tsBuildInfoFile": "./tsconfig.tsbuildinfo", "paths": { "@grafana/schema/dist/esm/*": ["../packages/grafana-schema/src/*"] - }, - - "types": ["vite/client"] + } }, "ts-node": { "compilerOptions": {