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

eslint rule to check decorator present #197

Closed
tidou44 opened this issue May 20, 2022 · 1 comment
Closed

eslint rule to check decorator present #197

tidou44 opened this issue May 20, 2022 · 1 comment

Comments

@tidou44
Copy link

tidou44 commented May 20, 2022

Hello
I have been using until-destroy for a few months and I find this library very useful.
However, sometimes I use untilDestroyed(this) and forget to add the @until-destroy() decorator, which gives a runtime error.
Is there a way (eslint rule for example) to ensure that the decorator is present in all components using until-destroyed(this)?

@arturovt
Copy link
Collaborator

Nope, this is not possible. There're many ways of using the decorator. It can decorate a directive that is placed in a different file, a component can extend the directive, and untilDestroyed is used within this component. Considering the ESLint rule, that would've given an error (because AST is available only per file), but the usage is actually correct.

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