Are you an LLM? You can read better optimized documentation at /docs/guide/usage/linter/rules/eslint/capitalized-comments.md for this page in Markdown format
The first element specifies whether comments should "always" or "never" begin with a capital letter. The second element is an optional object containing additional options.
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
Configuration for the capitalized-comments rule.
The first element specifies whether comments should
"always"or"never"begin with a capital letter. The second element is an optional object containing additional options.The 1st option
type:
"always" | "never"The 2nd option
This option is an object with the following properties:
block
type:
objectConfiguration options specific to block comments.
block.ignoreConsecutiveComments
type:
booleanIf true, consecutive comments will be ignored after the first comment.
block.ignoreInlineComments
type:
booleanIf true, inline comments (comments in the middle of code) will be ignored.
block.ignorePattern
type:
stringA regex pattern. Comments that match the pattern will not cause violations.
ignoreConsecutiveComments
type:
booleanIf true, consecutive comments will be ignored after the first comment.
ignoreInlineComments
type:
booleanIf true, inline comments (comments in the middle of code) will be ignored.
ignorePattern
type:
stringA regex pattern. Comments that match the pattern will not cause violations.
line
type:
objectConfiguration options specific to line comments.
line.ignoreConsecutiveComments
type:
booleanIf true, consecutive comments will be ignored after the first comment.
line.ignoreInlineComments
type:
booleanIf true, inline comments (comments in the middle of code) will be ignored.
line.ignorePattern
type:
stringA regex pattern. Comments that match the pattern will not cause violations.
How to use
To enable this rule using the config file or in the CLI, you can use:
References