← Back

jsdoc/match-description warning

Enforces a regular expression pattern on descriptions to match English sentences.

Examples

❌  Incorrect

/**
 * foo.
 */
function quux1 () {

}
// Message: JSDoc description does not satisfy the regex pattern.

/**
 * Foo)
 */
function quux2 () {

}
// Message: JSDoc description does not satisfy the regex pattern.

/**
 * Foo
 */
function quux3 () {

}
// Message: JSDoc description does not satisfy the regex pattern.

/**
 * {@see Foo.bar} buz
 */
function quux4 (foo) {

}
// Message: JSDoc description does not satisfy the regex pattern.

/**
 * lorem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque elit diam,
 * iaculis eu dignissim sed, ultrices sed nisi. nulla at ligula auctor, consectetur neque sed,
 * tincidunt nibh. vivamus sit amet vulputate ligula. vivamus interdum elementum nisl,
 * vitae rutrum tortor semper ut. morbi porta ante vitae dictum fermentum.
 * proin ut nulla at quam convallis gravida in id elit. sed dolor mauris, blandit quis ante at,
 * consequat auctor magna. duis pharetra purus in porttitor mollis.
 */
function longDescription (foo) {

}
// Message: JSDoc description does not satisfy the regex pattern.

✅  Correct

/**
 *
 */
function quux1 () {

}

/**
 * Foo.
 */
function quux2 () {

}

/**
 * Foo.
 * Bar.
 */
function quux3 () {

}

/**
 * Foo.
 *
 * Bar.
 */
function quux4 () {

}

/**
 * Foo
 * bar.
 */
function quux5 () {

}

/**
 * Foo. {@see Math.sin}.
 */
function quux6 () {

}

/**
 * Foo {@see Math.sin} bar.
 */
function quux7 () {

}

/**
 * Foo?
 *
 * Bar!
 *
 * Baz:
 *   1. Foo.
 *   2. Bar.
 */
function quux8 () {

}

/**
 * Hello:
 * World.
 */
function quux9 () {

}

/**
 * Hello: world.
 */
function quux10 () {

}

/**
 * Foo
 * Bar.
 */
function quux11 () {

}

/**
 * Foo.
 *
 * foo.
 */
function quux12 () {

}