Introducing the Kotlin/JS Inspection Pack: IR Migration Help, Quick-Fixes, and More
We’re introducing a new plugin for your Kotlin/JS applications – the Kotlin/JS Inspection Pack. It adds valuable inspections and quick-fixes that help you build and maintain your Kotlin/JS projects.
The plugin is especially helpful if you want to migrate your projects to the new Kotlin/JS IR compiler that’s been promoted to Beta in the latest 1.5.30 release. There are some major differences between the legacy compiler and the new one, so switching your Kotlin/JS project to the new backend may require some changes in your code. Fortunately, the Kotlin/JS Inspection Pack has a number of quick-fixes that should simplify the process. Try the Kotlin/JS IR backend.
How to get the plugin
The plugin is compatible with versions 2020.3 and later of both IntelliJ IDEA and Android Studio.
Inspections and quick-fixes in the Kotlin/JS Inspection Pack
While the Kotlin/JS Inspection Pack can help you fix common migration issues, we recommend checking out our Kotlin/JS IR migration guide to get the broader picture. Now let’s have a look at the tips that the Kotlin/JS Inspection Pack can provide.
Turn JS and React-related classes and interfaces into external interfaces
The plugin highlights such classes and interfaces and offers to turn them into external interfaces:
Make properties of external interfaces mutable
When working with external interfaces, pay attention to immutable properties. You can assign values to them only after the object is created with
As a workaround, make such properties mutable
var properties, following the plugin’s suggestions:
Make boolean variables nullable in external interfaces
To prevent another ClassCastException error, the Kotlin/JS Inspection Pack underlines boolean properties in external interfaces and advises making them nullable (
The current scope of the plugin is only the beginning. We’re planning to add more inspections to make Kotlin/JS development easier for you. Stay tuned!
If you have any feedback, encounter any issues, or want to suggest new inspections for the plugin, please don’t hesitate to report them in our issue tracker. Thank you!