-
-
Notifications
You must be signed in to change notification settings - Fork 163
feat: add require-asterisk-prefix rule #446
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
Conversation
This rule should be |
The challenge I see with a /**
User encapsulates the data and methods needed to manage user objects.
**Never instantiate this without a FIPS-compliant crypto module installed!**
*some italics for good measure*
@param {string} userId
*/
class User { ... } Two lines in this jsdoc block in a naive solution would be incorrectly marked as problems due to having a |
The way I interpret these options is:
Always require a
Never require a The only check for never that I would possibly suggest would be to fail the check if ALL lines start with a BAD /**
* A comment
* that follows
* a pattern
*/ GOOD /**
* A comment
*that does
*not follows
** a pattern
*/ Thanks for putting this PR together. Hope my comment helps. |
How does |
If you add the check to ensure the If you don't add that check then it would have no difference at all, which is not great but not necessarily a bad thing either in this case. |
I figure some might also end up asking for an "asterisks multiline everywhere except in certain tags" style as well (e.g., |
Both types should now be easier to support with |
d50aace
to
24fe60e
Compare
917d748
to
4c97c2a
Compare
I think this PR may be ready now. There can probably be improvements in adding missing asterisks, but it isn't always clear how to do this, e.g., if someone had: /**
*
Desc.
*/ or /**
*
Desc.
*/ ...we should probably use the asterisks before and after to align them, but the problem is that any or all of them might be out of alignment, even on purpose. Right now, our fixer to add the asterisk just:
|
This rule checks that each line of the jsdoc comment starts with an asterisk. For composability with other rules, this does not check the alignment or indentation of the comment content. fix gajus#199
…pport; begin schema for options but options object not yet supported
fe5cfa9
to
fd91593
Compare
Two further comments:
|
🎉 This PR is included in version 33.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This rule checks that each line of the jsdoc comment starts with an asterisk. For composability with
other rules, this does not check the alignment or indentation of the comment content.
The naming of this rule is entirely provisional - better name suggestions welcome!Fixes #199