Requires the first alphabetical character of a comment to be uppercase, unless it is part of a multi-line textblock.
This rule automatically ignores jscs, jshint, eslint and istanbul specific comments.
Types: Boolean
or Object
Values:
true
Object
:allExcept
: array of quoted exceptionsinlined
: Ignore comments in the middle of the code line"requireCapitalizedComments": true
// Valid
//Valid
/*
Valid
*/
/**
* Valid
*/
// A textblock is a set of lines
// that starts with a capitalized letter
// and has one or more non-capitalized lines
// afterwards
// A textblock may also have multiple lines.
// Those lines can be uppercase as well to support
// sentence breaks in textblocks
// 123 or any non-alphabetical starting character
// @are also valid anywhere
// jscs: enable
// invalid
//invalid
/** invalid */
/**
* invalid
*/
"requireCapitalizedComments": { "allExcept": ["pragma"] }
function sayHello() {
/* pragma something */
// I can now say hello in lots of statements, if I like.
return "Hello";
}
function sayHello() {
/* istanbul ignore next */
// I'd like to ignore this statement in coverage reports.
return "Hello";
}
function sayHello() {
/* otherPragma something */
// i can now say hello in lots of statements, if I like.
return "Hello";
}
"requireCapitalizedComments": { "inlined": true }
function sayHello( world /*internal*/ ) {
}