Can I use compileOnly {transitive = true} or something like this

I have a project A which
implementation project(":LibA")

And the LibA have a
compileOnly(project(":LibAA")) { transitive = true }

And now A can’t use libAA.

I have to repeat the compileOnly(project(":LibAA")) in project A.

Is there a way to do this without repeat?