-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
@ts-expect-error breaking app. #6999
Comments
lll grab this issue |
The fix for this seems to be pretty easy, but Id like to be able to recreate it for I do that. What are the actual steps to recreate this? I created a file that has https://deno.land/std@0.64.0/node/_util/_util_promisify.ts as a dependency, but did not see any errors on run or bundle commands. |
@JayHelton I can’t tell of an specific way to recreate it because it’s happening at Mandarine’s core when upgrading to std 0.64.0. I’ll investigate if I can isolate this in an example. |
Like last time, it's happening probably because you have a weakened - // @ts-expect-error TypeScript (as of 3.7) does not support indexing namespaces by symbol
- const argumentNames = original[kCustomPromisifyArgsSymbol];
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const argumentNames = original[kCustomPromisifyArgsSymbol as any]; but you'll probably have to do similar things at other |
@nayeemrmn That may be it. Mandarine's tsconfig:
{
"compilerOptions": {
"strict": false,
"noImplicitAny": false,
"noImplicitThis": false,
"alwaysStrict": false,
"strictNullChecks": false,
"strictFunctionTypes": true,
"strictPropertyInitialization": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"allowUmdGlobalAccess": false,
}
} |
But we shouldn't replace it with |
@nayeemrmn @kitsonk Im of the opinion that we should just use @ts-ignore for this use case, and using @ts-expect-error just causes issues for those who use typescript, but dont use a strict tsconfig (which is totally fine, imo). Id rather some lines to ignore the error, instead of coercing the type system in an arguably more complicated and hard to read way. Im sure its possible, im just not sure how succinct it would be. |
@JayHelton Why wouldn't it work for |
here is the code that produces the error:
I believe typescript only supports indexing by string and number. |
Oops, you're right. The comment in the - // @ts-expect-error TypeScript (as of 3.7) does not support indexing namespaces by symbol
- if (original[kCustomPromisifiedSymbol]) {
- // @ts-expect-error TypeScript (as of 3.7) does not support indexing namespaces by symbol
- const fn = original[kCustomPromisifiedSymbol];
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ if ((original as any)[kCustomPromisifiedSymbol]) {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const fn = (original as any)[kCustomPromisifiedSymbol] as Function; |
Fixed in #7024. |
[Details]
I have a transitive dependency that is using
https://deno.land/std@0.64.0/node/_util/_util_promisify.ts
which has@ts-expect-error
.When using
strict=true
, it throws the same errors, and also, oak 6.0.1 breaks.This was solved before but now it started happening again in STD with the exact same behavior. This was solved here: #6033 by @kitsonk in #6038 .
[Environment]
deno 1.2.3
v8 8.6.334
typescript 3.9.2
[Additional]
This behavior started happening in std >= 0.63.0 as it is not happening in std 0.62.0
The text was updated successfully, but these errors were encountered: