Closed
Description
ESLint Config
{
"jsdoc/lines-before-block": "error"
}
ESLint sample
declare class SomeClass {
// Not ok:
constructor(
/** Some doc */
param: number,
);
// Not ok:
method(
/** Some doc */
param: number,
): void;
// Ok:
/** Some doc */
prop: number;
}
// Not ok:
type SomeFunctionAlias =
/**
* @param param - Some doc.
*/
(param: number) => void;
// Not ok:
type SomeFunctionAlias2 = (
/**
* @param param - Some doc.
*/
param: number
) => void;
Environment
- Node version: v20.15.0
- ESLint version v9.26.0
eslint-plugin-jsdoc
version: ^50.6.11
Expected behavior
I expected there to be a configuration option to be able to avoid having to add newlines before all of the places linted in that snippet.
Actual behavior
The rule requires adding a newline but this causes conflicts with Prettier. Subjectively I also think it looks ugly.