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

no error when getting a property with no getter #49288

Closed
DetachHead opened this issue May 28, 2022 · 2 comments
Closed

no error when getting a property with no getter #49288

DetachHead opened this issue May 28, 2022 · 2 comments

Comments

@DetachHead
Copy link
Contributor

Bug Report

πŸ”Ž Search Terms

setter without getter

πŸ•— Version & Regression Information

4.8.0-dev.20220527

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

class Foo {
    set foo(value: string) {}
}

const foo = new Foo()

console.log(foo.foo.toUpperCase()) // runtime error

πŸ™ Actual behavior

no error

πŸ™‚ Expected behavior

either an error when defining the setter if it shouldn't be allowed, or an error when accessing the foo property (as its type is undefined)

@MartinJohns
Copy link
Contributor

Duplicate of #30852. Check out the ESLint rule accessor-pairs.

@DetachHead
Copy link
Contributor Author

thanks. btw the open issue is #21759

@DetachHead DetachHead closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2022
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