-
-
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
Line break before JSDoc blocks #1209
Comments
BREAKING CHANGE: Adds new rule to recommended
BREAKING CHANGE: Adds new rule to recommended
BREAKING CHANGE: Adds new rule to recommended
BREAKING CHANGE: Adds new rule to recommended
BREAKING CHANGE: Adds new rule to recommended
BREAKING CHANGE: Adds new rule to recommended
BREAKING CHANGE: Adds new rule to recommended
🎉 This issue has been resolved in version 49.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Using this with prettier is at least trickier. It should have been disabled by default |
@lamuertepeluda I have not updated to test the new rule yet, but when I wrote these we were using Prettier (and still are) and it did not handle this, otherwise I would most likely not have written the post. Or are you saying Prettier does handle this with a line break before JSDoc comment blocks, and I must have just done something awfully wrong to miss that? |
sorry I didn't mention that I am using prettier + https://www.npmjs.com/package/prettier-plugin-jsdoc in my previous post and that it was like prettier removing the line and eslint adding the line with this rule enabled (or the other way around, sorry I am currently on a week off so I cannot check on my PC 😅). We have both prettier and eslint hooks on save. |
@lamuertepeluda I do not think this plugin here can take into account all other plugins that exist, such as https://www.npmjs.com/package/prettier-plugin-jsdoc which is not wildly used either. I think you need to disable the rule as you did. I like that this was added as default by @brettz9 (albeit of course fixing the two above bugs would be nice). |
I have since removed the rule from the recommended rules until such time as we may fix the bugs. At such a time, I would like to move the rule back (as again, I don't think it should conflict with prettier since it should just be adding a line, and prettier shouldn't need to collapse lines around JSDoc--at least I've never seen that happen). |
Agreed but for backward compatibility I would have expected it to be off by default. Anyways, thanks for your hard work on this plugin 🙌 and if anyone else is having such issues with prettier can just turn this rule off. |
It was released as part of a semantic major version, so breaking changes should be expected in such cases. But again, there were some issues with the rule, so disabling for now.
Thank you.
Sure. |
Motivation
It would be nice to always force line breaks before
/**
blocks as code reads nicer that way, akin to chapters in a book.Current behavior
There is no such rule.
Desired behavior
To add such rule.
Alternatives considered
https://eslint.style/rules/js/lines-around-comment exists, and maybe I should use that instead? But I wrote this anyway as this package is about specifically JSDoc. I am fine however to use https://eslint.style/rules/js/lines-around-comment if there is no interest to include it here.
The text was updated successfully, but these errors were encountered: