Appearance
Enforces or disallows capitalization of the first letter of a comment.
Inconsistent capitalization of comments can make code harder to read. This rule helps enforce a consistent style across the codebase.
Examples of incorrect code for this rule with the default "always" option:
"always"
// lowercase comment /* lowercase block comment */
Examples of correct code for this rule with the default "always" option:
// Capitalized comment /* Capitalized block comment */ // 123 - comments starting with non-letters are ignored
This rule accepts a configuration object with the following properties:
type: object | null
object | null
type: boolean | null
boolean | null
type: string | null
string | null
To enable this rule using the config file or in the CLI, you can use:
{ "rules": { "capitalized-comments": "error" } }
oxlint --deny capitalized-comments
eslint/capitalized-comments Style
What it does
Enforces or disallows capitalization of the first letter of a comment.
Why is this bad?
Inconsistent capitalization of comments can make code harder to read. This rule helps enforce a consistent style across the codebase.
Examples
Examples of incorrect code for this rule with the default
"always"option:Examples of correct code for this rule with the default
"always"option:Configuration
This rule accepts a configuration object with the following properties:
block
type:
object | nullblock.ignoreConsecutiveComments
type:
boolean | nullblock.ignoreInlineComments
type:
boolean | nullblock.ignorePattern
type:
string | nullignoreConsecutiveComments
type:
boolean | nullignoreInlineComments
type:
boolean | nullignorePattern
type:
string | nullline
type:
object | nullline.ignoreConsecutiveComments
type:
boolean | nullline.ignoreInlineComments
type:
boolean | nullline.ignorePattern
type:
string | nullHow to use
To enable this rule using the config file or in the CLI, you can use:
References