Rule: comment-format

Enforces formatting rules for single-line comments.

Rationale

Helps maintain a consistent, readable style in your codebase.

Config

Three arguments may be optionally provided:

  • "check-space" requires that all single-line comments must begin with a space, as in // comment
    • note that comments starting with /// are also allowed, for things such as ///<reference>
  • "check-lowercase" requires that the first non-whitespace character of a comment must be lowercase, if applicable.
  • "check-uppercase" requires that the first non-whitespace character of a comment must be uppercase, if applicable.
Examples
"comment-format": [true, "check-space", "check-lowercase"]
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "check-space",
      "check-lowercase",
      "check-uppercase"
    ]
  },
  "minLength": 1,
  "maxLength": 3
}