-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Bug: [no-unsafe-call] process.exit(1) is an "error" type typed value #9625
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
Comments
Hmmm, fun. Are |
Hi @CreativeTechGuy! Does this repro for you locally or just in the playground? We've had some trouble with types in the playground lately, for example see #9594 and #8696
As also discussed in #9591, #9304 made no changes to whether or not the rule reports - it just changes whether the error messages say "Unsafe call of an |
Yes this repos locally which is how I found it when updating dependencies. So it's not just the playground @kirkwaiblinger |
@Josh-Cena Looks like no; this doesn't flag.... function neverTypedFunction(): never {
throw new Error();
}
neverTypedFunction(); |
@CreativeTechGuy |
I don't know the exact version this was introduced. But I can confirm that 7.14.1 was working. So something between 7.15.0-7.16.1 changed. |
Just dropping one further breadcrumb for investigation, other functions on process.getActiveResourcesInfo() as well as other imported node types import { relative } from "node:path";
relative("foo", "bar"); |
Could someone post a standalone reproduction that isn't the playground please? We'll want to investigate this locally. |
This is likely a local setup issue yeah. Need a repro to investigate further. |
I'll work on a repro early next week. Thank you for looking into this! |
It looks like it was a configuration issue. I had a global type augmentation for So I concede that it was user error and can be fixed. The error message was very confusing and for some reason didn't show up until I updated dependencies. Although I'm having a hard time finding a minimal reproduction. Could the message "Unsafe call of an `error` type typed value" be renamed to something like "Unsafe call of an untyped value" or something like that? Something to indicate that it's an error because TS ESLint doesn't see it's type even though your editor/typescript does. That'd be helpful and point people in the direction of it being a configuration error with typescript configured differently than eslint. |
Thanks for following up!
Let's use #9591 for that discussion. Cheers 🙂 |
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.5.3&fileType=.tsx&code=JYWwDg9gTgLgBAbzgUwB7HgXzgMyhEOAIgDsIATZALjHwGNkBnRogbgFgAoLtDACgCMASi5daEBswB0vGIKFA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1tieQEMAZolpk%2B8eOiiJo0DtEjgwAXxBKgA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false
Repro Code
tsconfig
Expected Result
I expected
process.exit(1)
to not be an error.Actual Result
There was an error when calling
process.exit(1)
Additional Info
I believe this error was introduced in #9304
The text was updated successfully, but these errors were encountered: