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

Warn in dev mode for methods/props missing an @api #3641

Closed
nolanlawson opened this issue Jul 21, 2023 · 3 comments
Closed

Warn in dev mode for methods/props missing an @api #3641

nolanlawson opened this issue Jul 21, 2023 · 3 comments
Labels
enhancement Up for grabs Issues that are relatively small, self-contained, and ready for implementation

Comments

@nolanlawson
Copy link
Collaborator

export default class extends LightningElement {
  get foo () { return 'foo' }
}
console.log(elm.foo) // undefined

This logs undefined because the class is missing an @api on the get foo(). It would be great to have a dev-only warning to provide a hint that the component author has forgotten to add an @api.

@nolanlawson nolanlawson added the Up for grabs Issues that are relatively small, self-contained, and ready for implementation label Aug 11, 2023
@jmsjtu jmsjtu mentioned this issue Sep 7, 2023
@yashpatel1998
Copy link
Contributor

yashpatel1998 commented Sep 11, 2023

@nolanlawson Can I grab this issue?

@nolanlawson
Copy link
Collaborator Author

@yashpatel1998 Sure thing! 😀

@AllanOricil
Copy link
Contributor

@yashpatel1998 I tried this one because it is in the list I asked #3700

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Up for grabs Issues that are relatively small, self-contained, and ready for implementation
Projects
None yet
Development

No branches or pull requests

3 participants