function checkMetaDocsDescription(context, exportsNode) {
    if (exportsNode.type !== "ObjectExpression") {

        // if the exported node is not the correct format, "internal-no-invalid-meta" will already report this.
        return;
    }

    const metaProperty = getPropertyFromObject("meta", exportsNode);
    const metaDocs = metaProperty && getPropertyFromObject("docs", metaProperty.value);
    const metaDocsDescription = metaDocs && getPropertyFromObject("description", metaDocs.value);

    if (!metaDocsDescription) {

        // if there is no `meta.docs.description` property, "internal-no-invalid-meta" will already report this.
        return;
    }

    const description = metaDocsDescription.value.value;

    if (typeof description !== "string") {
        context.report({
            node: metaDocsDescription.value,
            message: "`meta.docs.description` should be a string."
        });
        return;
    }

    if (description === "") {
        context.report({
            node: metaDocsDescription.value,
            message: "`meta.docs.description` should not be empty."
        });
        return;
    }

    if (description.indexOf(" ") === 0) {
        context.report({
            node: metaDocsDescription.value,
            message: "`meta.docs.description` should not start with whitespace."
        });
        return;
    }

    const firstWord = description.split(" ")[0];

    if (ALLOWED_FIRST_WORDS.indexOf(firstWord) === -1) {
        context.report({
            node: metaDocsDescription.value,
            message: "`meta.docs.description` should start with one of the following words: {{ allowedWords }}. Started with \"{{ firstWord }}\" instead.",
            data: {
                allowedWords: ALLOWED_FIRST_WORDS.join(", "),
                firstWord
            }
        });
    }
}
function checkMetaDocsDescription(context, exportsNode) {
    if (exportsNode.type !== "ObjectExpression") {

        // if the exported node is not the correct format, "internal-no-invalid-meta" will already report this.
        return;
    }

    const metaProperty = getPropertyFromObject("meta", exportsNode);
    const metaDocs = metaProperty && getPropertyFromObject("docs", metaProperty.value);
    const metaDocsDescription = metaDocs && getPropertyFromObject("description", metaDocs.value);

    if (!metaDocsDescription) {

        // if there is no `meta.docs.description` property, "internal-no-invalid-meta" will already report this.
        return;
    }

    const description = metaDocsDescription.value.value;

    if (typeof description !== "string") {
        context.report({
            node: metaDocsDescription.value,
            message: "`meta.docs.description` should be a string."
        });
        return;
    }

    if (description === "") {
        context.report({
            node: metaDocsDescription.value,
            message: "`meta.docs.description` should not be empty."
        });
        return;
    }

    if (description.indexOf(" ") === 0) {
        context.report({
            node: metaDocsDescription.value,
            message: "`meta.docs.description` should not start with whitespace."
        });
        return;
    }

    const firstWord = description.split(" ")[0];

    if (ALLOWED_FIRST_WORDS.indexOf(firstWord) === -1) {
        context.report({
            node: metaDocsDescription.value,
            message: "`meta.docs.description` should start with one of the following words: {{ allowedWords }}. Started with \"{{ firstWord }}\" instead.",
            data: {
                allowedWords: ALLOWED_FIRST_WORDS.join(", "),
                firstWord
            }
        });
    }
}
function checkMetaDocsDescription ( context , exportsNode ) { if ( exportsNode . type !== "ObjectExpression" ) { // if the exported node is not the correct format, "internal-no-invalid-meta" will already report this. return ; } const metaProperty = getPropertyFromObject ( "meta" , exportsNode ) ; const metaDocs = metaProperty && getPropertyFromObject ( "docs" , metaProperty . value ) ; const metaDocsDescription = metaDocs && getPropertyFromObject ( "description" , metaDocs . value ) ; if ( ! metaDocsDescription ) { // if there is no `meta.docs.description` property, "internal-no-invalid-meta" will already report this. return ; } const description = metaDocsDescription . value . value ; if ( typeof description !== "string" ) { context . report ( { node : metaDocsDescription . value , message : "`meta.docs.description` should be a string." } ) ; return ; } if ( description === "" ) { context . report ( { node : metaDocsDescription . value , message : "`meta.docs.description` should not be empty." } ) ; return ; } if ( description . indexOf ( " " ) === 0 ) { context . report ( { node : metaDocsDescription . value , message : "`meta.docs.description` should not start with whitespace." } ) ; return ; } const firstWord = description . split ( " " ) [ 0 ] ; if ( ALLOWED_FIRST_WORDS . indexOf ( firstWord ) === - 1 ) { context . report ( { node : metaDocsDescription . value , message : "`meta.docs.description` should start with one of the following words: {{ allowedWords }}. Started with \"{{ firstWord }}\" instead." , data : { allowedWords : ALLOWED_FIRST_WORDS . join ( ", " ) , firstWord } } ) ; } }
Verifies that the meta.docs.description property follows our internal conventions.

@param {RuleContext} context The ESLint rule context.
@param {ASTNode} exportsNode ObjectExpression node that the rule exports.
@returns {void}
Verifies that the meta . docs . description property follows our internal conventions .
Check the meta. docs. description property of the exported node