-
-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Multiline block] Enforce text on zero and last lines #830
Comments
But the rule should allow for empty descriptions if no next is following, e.g., if there is only a tag? |
Hi @brettz9, thanks for the quick reply! Like /**
* @param foo
* @param bar
*/ ? I globally searched now in some of my projects and haven't seen any multiline having a tag on the zeroth line, like /** @param foo
* @param bar */ It looks awful to me this misalignment, I wouldn't do this at all. You did a nice observation. For texts, it just seems like an ok paragraph, better than wasting an entire line to the opener. The only cases I have a tag on the zeroth line is when it's a single line JSDoc, for @default. Seems that when I have a tag on multilines, I always start with a description text. Personally, this case is for me a don't care situation as I never did it and certainly never will. I don't have experience writing ESLint rules, but regarding this, maybe the easiest solution should be done. |
Yes I meant cases like you mention or just: /**
* @param foo
*/ or: /**
*
*/ I think this shouldn't report anything, as someone wanting to disallow can just use |
Yes, those seem cases that can be handled by other rules. |
You should now be able to use |
🎉 This issue has been resolved in version 39.6.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) | devDependencies | patch | [`39.6.0` -> `39.6.2`](https://renovatebot.com/diffs/npm/eslint-plugin-jsdoc/39.6.0/39.6.2) | --- ### Release Notes <details> <summary>gajus/eslint-plugin-jsdoc</summary> ### [`v39.6.2`](https://github.com/gajus/eslint-plugin-jsdoc/releases/tag/v39.6.2) [Compare Source](gajus/eslint-plugin-jsdoc@v39.6.1...v39.6.2) ##### Bug Fixes - update `jsdoccomment` ([26141cb](gajus/eslint-plugin-jsdoc@26141cb)) ### [`v39.6.1`](https://github.com/gajus/eslint-plugin-jsdoc/releases/tag/v39.6.1) [Compare Source](gajus/eslint-plugin-jsdoc@v39.6.0...v39.6.1) ##### Bug Fixes - **`no-restricted-syntax`:** update jsdoccomment to be able to use new `descriptionStartLine`, `descriptionEndLine`, and `hasPreterminalDescription` properties; fixes [#​830](gajus/eslint-plugin-jsdoc#830) ([d68d742](gajus/eslint-plugin-jsdoc@d68d742)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMi4xIiwidXBkYXRlZEluVmVyIjoiMzQuMjEuMiJ9--> Co-authored-by: cabr2-bot <[email protected]> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1625 Reviewed-by: Epsilon_02 <[email protected]> Co-authored-by: Calciumdibromid Bot <[email protected]> Co-committed-by: Calciumdibromid Bot <[email protected]>
Motivation
I have a different taste for JSDoc. Never saw anyone doing it but for me it just looks way better by not having an entire line wasted just for the opener / closer.
Example:
is WAY better (at least for me) than
Current behavior
multiline-blocks
options allow them, but do no enforce them. Everyday I have to manually fix my JSDocs to fit my taste.Desired behavior
multiline-blocks
options to enforce that/**
is proceeded and*/
is be preceded with text. They will remove newlines and stars between them and any text.Alternatives considered
Change my taste. But NO! Lines are too important to be wasted with just two or three meta characters.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: