Skip to content

prettier doesn't correct EmptyLineSeparator for checkstyle with comments #647

@xenoterracide

Description

@xenoterracide
        "@prettier/plugin-xml": "^3.2.2",
        "prettier": "^3.1.1",
        "prettier-plugin-java": "^2.5.0",
        "prettier-plugin-properties": "^0.3.0",
        "prettier-plugin-sh": "^0.14.0",
        "prettier-plugin-toml": "^2.0.1"

Input:

// SPDX-License-Identifier: Apache-2.0
// Copyright © 2018-2024 Caleb Cushing.
package com.xenoterracide.gradle.semver;

Output:

// SPDX-License-Identifier: Apache-2.0
// Copyright © 2018-2024 Caleb Cushing.
package com.xenoterracide.gradle.semver;

Expected behavior:

// SPDX-License-Identifier: Apache-2.0
// Copyright © 2018-2024 Caleb Cushing.

package com.xenoterracide.gradle.semver;

expected behavior is simply derived from the checkstyle config which contains, I'm indifferent to correcting prettier, or correcting checkstyle. For now I've worked around this by simply changing my spotless config to output \n\n instead of just \n

    <module name="EmptyLineSeparator">
      <property
        name="tokens"
        value="PACKAGE_DEF, IMPORT, STATIC_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
                    STATIC_INIT, INSTANCE_INIT, CTOR_DEF, VARIABLE_DEF, RECORD_DEF,
                    COMPACT_CTOR_DEF"
      />
      <property name="allowNoEmptyLineBetweenFields" value="true" />
    </module>

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