question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rule Proposal: comment-capitalizing

See original GitHub issue

From requireCapitalizedComments and disallowCapitalizedComments.

This rule will enforce which the first character is an upper case or a lower case.

{
    "comment-capitalizing": ["error", "always" or "never"],
    // or
    "comment-capitalizing": [
        "error",
        {
            "capitalize": "always" or "never",
            "markers": ["*"],
            "ignorePattern": "^\s*(?:eslint|jshint|jslint|istanbul|global|exported|jscs|falls?\s?through)",
            "ignoreInlineComments": false,
            "overrides": {
                "block": null,  // e.g. "always", {capitalize: "always", markers: ["!"]}, ...
                "line": null
            }
        }
    ]
}
  • "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 that markers option has matched) matches the given regexp pattern, this rule ignore the comment.
  • ignoreInlineComments (default is false) - If this is true, this rule will be applied to only comments which are at the head of each line. (from requireCapitalizedComments’s inlined option)
  • overrides - People can override setting for each line or block comment.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:18 (17 by maintainers)

github_iconTop GitHub Comments

4reactions
platinumazurecommented, Aug 2, 2016

@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.

1reaction
platinumazurecommented, Aug 17, 2016

@nzakas I’d like to propose a modification to @mysticatea’s proposal in that case:

  • onlyHeader option to be renamed to ignoreInlineComments, with the values still being boolean, default false, and having the same meaning as the proposal.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Proposed rule: Private Fund Advisers - SEC.gov
“Commission”) is proposing for public comment 17 CFR 275.206(4)-10 (new rule ... Discussion of Proposed Rules for Private Fund Advisers .
Read more >
3. Capitalization Rules - GovInfo
The full names of existing or proposed organized bodies and their shortened names are capitalized ; other substitutes, which are most often regarded...
Read more >
Rulemakings and Proposals for Comment - NCUA
The NCUA periodically solicits public comment on proposed rules and regulations, and other matters and publishes these notices in the ...
Read more >
IRS Issues Proposed Regs on Capitalizing Cost of Intangibles
[11] The proposed regulations require capitalization of amounts paid to acquire, ... The IRS and Treasury Department invite comments on this safe harbor ......
Read more >
Capitalization of Interest in Connection with Loan Workouts ...
NASCUS Comments on Proposed Rule: Capitalization of Interest in Connection with Loan Workouts and Modifications [RIN 3133 – AF30].
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found