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
Rule Proposal: comment-capitalizing #6055
Comments
+1 From me. Also it is possible to add to this rule a check for "." at the end of comment? |
@akuznetsov-gridgain I would suggest creating a separate issue for your request. (In your issue, please note if there is a JSCS equivalent or not, so we know whether or not we should treat the new issue as JSCS compatibility related or not.) Also, I'd like to try implementing this |
@mysticatea Any idea how to handle non-ASCII characters? What about non-letters, should those trigger the rule under any circumstances or not? |
@eslint/eslint-tsc I don't know if we still want to expedited-accept JSCS compat issues or if we should go through the usual new rule process. I have a couple of open questions about non-ASCII and non-letter characters, but this otherwise seems like an actionable proposal and I think this should be accepted. If we are not expediting JSCS compat issues, I will champion this rule. |
I think default |
@platinumazure we should try to follow the regular process here, so you can champion it. |
@platinumazure In Japanese, we don't have upper/lower cases. This rule simply should ignore Japanese letter. (though I'm not sure about other languages). I think |
Ah... This rule should skip markers. It may need |
Okay, by my count of 👍's on my champion comment, I think this is ready to roll. I'll try to get this out within the next week or so. (I'm moving house on Friday, though, so my life will be chaotic for the next few days.) @mysticatea Could I ask you to edit the first post with the |
Started working on this. It'll be another day or two before I have a branch up, but I've already got some questions:
|
Inline - yes, that's what it means. IgnoreWords - I think we should always ignore the four defaults and not allow them to be unignored (so they shouldn't be part of configuration, only internal). JSDoc comments are treated the same as any other. |
@markelog can you double check what I said? @platinumazure I think the JSCS unit tests are a good resource when questions come up: https://github.com/jscs-dev/node-jscs/blob/master/test/specs/rules/require-capitalized-comments.js |
@nzakas I'd like to propose a modification to @mysticatea's proposal in that case:
|
@platinumazure I'm sorry for my slow response. I have missed notification. I edited the first post by some suggestions.
|
Yeah, it is even mentioned in the valid/invalid rule examples. On the side note, right now, I would just implement JSCS options and consider implementing others if there would be sufficient enough amount of users to want them |
Started work on this. Documentation is pretty much done (well, unless we want more examples of different combinations of options). Rule logic seems to be done, now I'm just writing test cases and squashing bugs. I'll get a branch up this weekend once I've made some more progress. @eslint/eslint-tsc Strong opinions on whether to include |
I've been beavering away at this for the last couple of days, and I think I'll have a PR (re)opened tomorrow. Decisions I've made unilaterally (subject to discussion in the PR):
Still left:
The "textblock" bit should be the last thing I need to do before it's ready for review. |
New PR is open: #7415. |
From requireCapitalizedComments and disallowCapitalizedComments.
This rule will enforce which the first character is an upper case or a lower case.
"always"
(default) - Requires the first alphabetical character of a comment to be uppercase, unless it is part of a multi-line textblock."never"
- Requires the first alphabetical character of a comment to be lowercase.markers
(default is["*"]
) - If the head of comments matched to markers, this rule cut the matched part off, then checks the comment capitalizing. (this is similar to the markers option of spaced-comment rule)ignorePattern
(default is"^\s*(?:eslint|jshint|jslint|istanbul|global|exported|jscs|falls?\s?through)"
) - If the comment content (except the part thatmarkers
option has matched) matches the given regexp pattern, this rule ignore the comment.ignoreInlineComments
(default isfalse
) - If this istrue
, this rule will be applied to only comments which are at the head of each line. (fromrequireCapitalizedComments
'sinlined
option)overrides
- People can override setting for each line or block comment.The text was updated successfully, but these errors were encountered: