Z
Zod3mo ago
Steve

Stephan Meijer - When exporting myschema's and ...

When exporting my schema's as a package and then importing them, I get errors...
ESLint: Unsafe member access .parseAsync on an `error` typed value.(@typescript-eslint/no-unsafe-member-access)
ESLint: Unsafe member access .parseAsync on an `error` typed value.(@typescript-eslint/no-unsafe-member-access)
and
ESLint: Unsafe call of an `error` type typed value.(@typescript-eslint/no-unsafe-call)
ESLint: Unsafe call of an `error` type typed value.(@typescript-eslint/no-unsafe-call)
for example in
import { Finding } from '@toegang-voor-iedereen/document-spec-types'
Finding.parseAsync({ x: 1 })
import { Finding } from '@toegang-voor-iedereen/document-spec-types'
Finding.parseAsync({ x: 1 })
The package '@toegang-voor-iedereen/document-spec-types' can be found here: - https://gitlab.com/toegang-voor-iedereen/specification/types/typescript - https://gitlab.com/toegang-voor-iedereen/specification/types/typescript/-/packages
Solution:
The basic issue is that typescript-eslint is getting an error from its own internal typescript compiler message. Usually restarting can help, but if it persists there might be a configuration issue in eslint or in the ide plugin
Jump to solution
16 Replies
Steve
SteveOP3mo ago
The package is installable by creating .npmrc with contents
@toegang-voor-iedereen:registry=https://gitlab.com/api/v4/packages/npm/
@toegang-voor-iedereen:registry=https://gitlab.com/api/v4/packages/npm/
No description
No description
Scott Trinh
Scott Trinh3mo ago
this sounds like eslint cannot get the type of the function correctly. most likely a eslint config issue.
Scott Trinh
Scott Trinh3mo ago
this is a variation on this problem that pops up from time-to-time on typescript-eslint: https://github.com/typescript-eslint/typescript-eslint/issues/9771
GitHub
Bug: [no-unsafe-assignment] "Unsafe assignment of an error typed va...
Before You File a Bug Report Please Confirm You Have Done The Following... I have tried restarting my IDE and the issue persists. I have updated to the latest version of the packages. I have search...
Steve
SteveOP3mo ago
Thanks. That sounds very vague. What can one do about it?
Scott Trinh
Scott Trinh3mo ago
Have you tried restarting the eslint lap server?
Steve
SteveOP3mo ago
I didn't mean your explanation was vague btw, but the error is Will try tomorrow to pry a bit into it Thanks for your help on this, appreciate it!
Solution
Scott Trinh
Scott Trinh3mo ago
The basic issue is that typescript-eslint is getting an error from its own internal typescript compiler message. Usually restarting can help, but if it persists there might be a configuration issue in eslint or in the ide plugin
Scott Trinh
Scott Trinh3mo ago
I want to write a blog post about this but I think it'll be a little bit better by the time I get around to writing it.
Steve
SteveOP3mo ago
Sounds buggy, if this is an IDE thing I will be switching editors. Let me know if I can contribute on that
Scott Trinh
Scott Trinh3mo ago
It's a typescript-eslint thing, especially the type-checking lint rules that runs its own compilation so it can be out of sync with, for instance, the LSP instance.
Steve
SteveOP3mo ago
Sounds buggy
Scott Trinh
Scott Trinh3mo ago
The eslint world is in a bit of a rough place right now, especially the typescript-eslint world. Next year maybe? I have a lot of trust in the maintainers of those tools that they'll work it out soon, though. It's a tough problem especially with the new flat config, and things like typescript project references
Steve
SteveOP3mo ago
Probably everything in the realm of static analysis and compiling stuff is quite tough Can't even wrap my head around the complexity that goes into writing those programs like eslint, typescript and typescript-eslint
Scott Trinh
Scott Trinh3mo ago
I have a suspicion that typescript-eslint and vscode-eslint are going to get it working soon, tbh. They're actively working on it
Steve
SteveOP3mo ago
Yeah btw this is Jetbrains Maybe VScode will give me better results
Scott Trinh
Scott Trinh3mo ago
Maybe! But the type-enabled rules in typescript-eslint are tough in-general for a long running thing like a language server. They'll figure it out though, I trust
Want results from more Discord servers?
Add your server