Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update typescript target level to improve stack traces #482

Open
phiresky opened this issue Feb 7, 2025 · 1 comment
Open

Update typescript target level to improve stack traces #482

phiresky opened this issue Feb 7, 2025 · 1 comment

Comments

@phiresky
Copy link

phiresky commented Feb 7, 2025

diff --git a/tsconfig.json b/tsconfig.json
index d9c7f76..c127552 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -6,7 +6,7 @@
     "noImplicitAny": true,
     "lib": ["es2017", "es7", "es6", "dom"],
     "outDir": "./dist",
-    "target": "ES2015",
+    "target": "ES2020",
     "experimentalDecorators": true,
     "strictNullChecks": true,
     "moduleResolution": "Node",

before:

Not Found

  964 |         }
  965 |         catch (_b) {
> 966 |             throw new Error(response.statusText);
      |                   ^
  967 |         }
  968 |         if (!response.ok) {
  969 |             throw new Error((_a = json["error"]) !== null && _a !== void 0 ? _a : response.statusText);

  at LemmyHttp.<anonymous> (../../lemmy-js-client/dist/http.js:966:19)
      at Generator.throw (<anonymous>)
  at rejected (../../lemmy-js-client/dist/http.js:15:65)

after

Not Found

  938 |     }
  939 |     catch {
> 940 |         throw new Error(response.statusText);
      |               ^
  941 |     }
  942 |     if (!response.ok) {
  943 |         throw new Error(json["error"] ?? response.statusText);

  at LemmyHttp._LemmyHttp_wrapper (../../lemmy-js-client/dist/http.js:940:15)
  at Object.<anonymous> (src/tags.spec.ts:150:16)

note the actual source location src/tags.spec.ts:150:16 is present after but not before

if compat is important even es2017 as target should fix this

@dessalines
Copy link
Member

dessalines commented Feb 9, 2025

Could you open a PR for this? thx.

EDIT: nm, I see you have it in your other PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants