Repository: eslint/eslint
File: lib/rules/multiline-comment-style.js (JavaScript)

Code before:
module.exports = {
    meta: {
        type: "suggestion",

        docs: {
            description: "Enforce a particular style for multiline comments",
            recommended: false,
            url: "https://eslint.org/docs/rules/multiline-comment-style"
        },

        fixable: "whitespace",
        schema: [
            {
                enum: ["starred-block", "separate-lines", "bare-block"]
            },
            {
                type: "object",
                properties: {
                    allowJSDoc: {
                        type: "boolean",
                        default: true
                    }
                },
                additionalProperties: false
            }
        ],
        messages: {
            expectedBlock: "Expected a block comment instead of consecutive line comments.",
            expectedBareBlock: "Expected a block comment without padding stars.",
            startNewline: "Expected a linebreak after '/*'.",
            endNewline: "Expected a linebreak before '*/'.",
            missingStar: "Expected a '*' at the start of this line.",
            alignment: "Expected this line to be aligned with the start of the comment.",
            expectedLines: "Expected multiple line comments instead of a block comment."
        }
    },

    create(context) {
        const sourceCode = context.getSourceCode();
        const option = context.options[0] || "starred-block";
        const params = context.options[1] || {};
        const allowJSDoc = "allowJSDoc" in params ? params.allowJSDoc : true;

        //----------------------------------------------------------------------
        // Helpers
        //----------------------------------------------------------------------

        /**
         * Checks if a comment line is starred.
         * @param {string} line A string representing a comment line.
         * @returns {boolean} Whether or not the comment line is starred.

Review comment (suggestion):
```suggestion
        schema: {
            anyOf: [
                {
                    type: "array",
                    items: [
                        {
                            enum: ["starred-block", "bare-block"]
                        }
                    ],
                    additionalItems: false
                },
                {
                    type: "array",
                    items: [
                        {
                            enum: ["separate-lines"]
                        },
                        {
                            type: "object",
                            properties: {
                                allowJSDoc: {
                                    type: "boolean"
                                }
                            },
                            additionalProperties: false
                        }
                    ],
                    additionalItems: false
                }
            ]
        },
```

Code after:
module.exports = {
    meta: {
        type: "suggestion",

        docs: {
            description: "Enforce a particular style for multiline comments",
            recommended: false,
            url: "https://eslint.org/docs/rules/multiline-comment-style"
        },

        fixable: "whitespace",
        schema: {
            anyOf: [
                {
                    type: "array",
                    items: [
                        {
                            enum: ["starred-block", "bare-block"]
                        }
                    ],
                    additionalItems: false
                },
                {
                    type: "array",
                    items: [
                        {
                            enum: ["separate-lines"]
                        },
                        {
                            type: "object",
                            properties: {
                                checkJSDoc: {
                                    type: "boolean"
                                }
                            },
                            additionalProperties: false
                        }
                    ],
                    additionalItems: false
                }
            ]
        },
        messages: {
            expectedBlock: "Expected a block comment instead of consecutive line comments.",
            expectedBareBlock: "Expected a block comment without padding stars.",
            startNewline: "Expected a linebreak after '/*'.",
            endNewline: "Expected a linebreak before '*/'.",
            missingStar: "Expected a '*' at the start of this line.",
            alignment: "Expected this line to be aligned with the start of the comment.",
            expectedLines: "Expected multiple line comments instead of a block comment."
        }