Android Lint picks up the string constant in this code sample as a spelling error on "dWQGSCDx". According to the docs I should use @SupressLint("Typos") to suppress it but that doesn't achieve that. I see others have suggested using @SuppressWarnings but that is not working either.
/**
* Constants.kt
*/
import android.annotation.SuppressLint
@SuppressLint("Typos")
@SuppressWarnings("SpellCheckingInspection")
const val SOME_STRING_VALUE = "...dWQGSCDx..."
Note this is a file-scoped global constant, it is not inside a class so an annotation cannot be placed on a containing class.
How do I suppress spell-checking of this constant definition without disabling spellcheck entirely and without adding the "mispelt" text to the dictionary?
In Kotlin you can suppress this warning using @Suppress
instead of @SuppressWarnings
with the following annotation
@Suppress("SpellCheckingInspection")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With