<!-- The bug you're experiencing might have already been reported! Please search in the [issues](https://github.com/pinterest/ktlint/issues) before creating one. --> ## Expected Behavior <!---Tell us what should happen. --> <!-- If relevant, provide a link to the relevant section in the [Kotlin Coding Conventions](https://kotlinlang.org/docs/coding-conventions.html) or [Android Kotlin Style Guide](https://developer.android.com/kotlin/style-guide). --> Formatting data classes with `//` comments should produce valid Kotlin code. <!-- Note: Ktlint should not produce any code which conflict with IntelliJ default code formatting. So please verify that your expectation is accepted by IntelliJ default code formatting. --> ## Observed Behavior <!---Tell us what happens instead of the expected behavior --> <!--- Provide the exact command which was executed but please --> <!--- ensure that the flag "--log-level=debug" is added to the --> <!--- command as well. Provide the output of this command. --> Auto fixing produces invalid Kotlin code that does not compile. ## Steps to Reproduce <!--- Provide a code example, or an unambiguous set of steps to --> <!--- reproduce this bug. Minimize the example to the bare --> <!--- minimum required to reproduce the bug. Small, well written --> <!--- example are proven to be resolved quicker. --> Run `ktlint -f` against the following Kotlin data class: ```kotlin data class Foo( // Foo val foo: String, val bar: String, ) ``` Results in: ```kotlin data class Foo( // Fooval foo: String, val bar: String,) ``` KtLint does not fail if you replace the `// Foo` comment with `/* Foo */`. ## Your Environment <!--- Include as many relevant details about the environment you experienced the bug in --> * Version of ktlint used: 1.3.0 * Relevant parts of the `.editorconfig` settings: An empty configuration reproduces this error.