Closed Lucky38i closed 3 weeks ago
That is an error in the documentation. Import statements can not be annotated in Kotlin. You need to use a file annotation like below:
@file:Suppress("ktlint:standard:no-wildcard-imports)
If you want to disable the rule for all files, it is better to disable it in the .editorconfig
file (docs)
Expected Behavior
I expect to be able to suppress an individual wildcard import in accordance with the FAQ section. however, I'm getting compilation issues.
Observed Behavior
I'm attempting to suppress an individual wildcard import I have in a project. However, I'm getting an error![Screenshot 2024-06-04 at 11 11 00](https://github.com/pinterest/ktlint/assets/26572019/6344dc52-d3b8-43d2-ac38-36b25dfccecc)
imports are only allowed at the beginning of the file
. Thus forcing me to do a file-wide suppression which is exactly what I don't want to do. Maybe I'm missing something silly but I'm not getting expected behaviour as shown in the FAQ pageYour Environment
1.2.1
.editorconfig
settings:standard ruleset
3.6.3
N/A
1.9.20
21