Skip to content

[2.9.2] prettier-ignore not being respected after annotation #890

Description

@boris-petrov

Prettier-Java 2.9.2

Playground link

# Options (if any):
--print-width 100

Input:

@What
// prettier-ignore
@SuppressFBWarnings({ "AFBR_ABNORMAL_FINALLY_BLOCK_RETURN", "LEST_LOST_EXCEPTION_STACK_TRACE", "BC_UNCONFIRMED_CAST_OF_RETURN_VALUE", "CC_CYCLOMATIC_COMPLEXITY" })
void foo() {
}

Output:

@What
// prettier-ignore
@SuppressFBWarnings({
	"AFBR_ABNORMAL_FINALLY_BLOCK_RETURN",
	"LEST_LOST_EXCEPTION_STACK_TRACE",
	"BC_UNCONFIRMED_CAST_OF_RETURN_VALUE",
	"CC_CYCLOMATIC_COMPLEXITY",
})
void foo() {}

Expected behavior:

@What
// prettier-ignore
@SuppressFBWarnings({ "AFBR_ABNORMAL_FINALLY_BLOCK_RETURN", "LEST_LOST_EXCEPTION_STACK_TRACE", "BC_UNCONFIRMED_CAST_OF_RETURN_VALUE", "CC_CYCLOMATIC_COMPLEXITY" })
void foo() {
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions