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
object
type: boolean
boolean
type: string
string
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:
objectblock.ignoreConsecutiveComments
type:
booleanblock.ignoreInlineComments
type:
booleanblock.ignorePattern
type:
stringignoreConsecutiveComments
type:
booleanignoreInlineComments
type:
booleanignorePattern
type:
stringline
type:
objectline.ignoreConsecutiveComments
type:
booleanline.ignoreInlineComments
type:
booleanline.ignorePattern
type:
stringHow to use
To enable this rule using the config file or in the CLI, you can use:
References