description-format
Enabling this rule will result in an error being generated if description
doesn't meet the configured options. Two options exist:
requireCapitalFirstLetter
- Throws an error if the first character in the description isn't capitalized.requireEndingPeriod
- Throws an error if the description doesn't end with a period.
Example .npmpackagejsonlintrc configuration
{
"rules": {
"description-format": ["error", {
"requireCapitalFirstLetter": true,
"requireEndingPeriod": true
}]
}
}
Rule Details
Incorrect example(s)
{
"description": "i'm a valid description."
}
{
"description": "I'm a valid description"
}
Correct example(s)
{
"description": "I'm a valid description."
}
requireCapitalFirstLetter
Example .npmpackagejsonlintrc configuration with only {
"rules": {
"description-format": ["error", {
"requireCapitalFirstLetter": true
}]
}
}
{
"rules": {
"description-format": ["error", {
"requireCapitalFirstLetter": true,
"requireEndingPeriod": false
}]
}
}
Rule Details
Incorrect example(s)
{
"description": "i'm a valid description."
}
Correct example(s)
{
"description": "I'm a valid description."
}
{
"description": "I'm a valid description"
}
requireEndingPeriod
Example .npmpackagejsonlintrc configuration with only {
"rules": {
"description-format": ["error", {
"requireEndingPeriod": true
}]
}
}
{
"rules": {
"description-format": ["error", {
"requireCapitalFirstLetter": false,
"requireEndingPeriod": true
}]
}
}
Rule Details
Incorrect example(s)
{
"description": "I'm a valid description"
}
Correct example(s)
{
"description": "I'm a valid description."
}
{
"description": "i'm a valid description."
}
History
- Introduced in version 3.3.0