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

bug: Calling isAddress shows linter warning "Unsafe call of a(n) error type typed value" #75

Open
daniel0ar opened this issue Jan 22, 2025 · 1 comment
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@daniel0ar
Copy link

Overview

Using isAddress in a typescript environment inside a condition throws es-lint warning Unsafe call of a(n) `error` type typed value.

Steps to reproduce

  1. Import the function:
import { isAddress } from "@solana/web3.js";
  1. Use it inside a condition when having es-lint running
if (isAddress("any_solana_address")) {
    // do something
}
  1. See warning appear on editor.

Description of bug

I hope to see no warning since the method should return a boolean or correctly document how to call it and get a value.

@daniel0ar daniel0ar added the bug Something isn't working label Jan 22, 2025
@steveluscher
Copy link
Collaborator

  1. What do you see when you console.log(isAddress)?
  2. What do you see when you hover over isAddress in your editor (ie. what type information does ESLint have access to at that point?)

@steveluscher steveluscher added the invalid This doesn't seem right label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants