RxLint, the lint check that helps you to write better RxJava code, has been updated with a couple of important changes.
- RxLint now supports both RxJava 2.x in addition to 1.x. All reactive types for both versions are now fully supported (Support for the 1.x Completable was still missing).
- A new check has been added to detect a “leaked” subscription. Leaking a subscription happens when you use
subcribe()
orsubscribeWith()
without capturing theSubscription
orDisposable
object in a variable. Not keeping a reference prevents you to callunsubscribe()
ordispose()
to unsubscribe which can lead to bugs and memory leaks.
In addition, the lint check has been rewritten to use the newer Psi-style lint check, so it is fully up to date with the current build tools again.
Using RxLint in your project is easy: just add the RxLint dependency to your project.
Happy linting!