Hi everyone, does anyone know the convention for d...
# ktlint
m
Hi everyone, does anyone know the convention for declaring typealiases in this case? I declared a single typealias in a file named TypeAliasUtils.kt but ktlint demands that the file should be named identical to the typealias I declared. Does this mean that I have to create different files for every typealias I declare? that seems a bit inefficient Any sort of advice or reading material is welcome thanks!!
m
I think just by looking at https://kotlinlang.org/docs/coding-conventions.html#source-file-names it seems that as long as you just have one type in the file, the file should be named accordingly according to the kotlin coding conventions. The moment you put a second type alias in that file, KTLint should not complain anymore I guess.
1
🙇 1
👀 1
r
alternatively you can just disable the filename rule in the top of your
TypeAliasUtils.kt
like this
Copy code
// ktlint-disable filename
package your.pkg.name
🙏 1