← Back

require-jsdoc-except/require-jsdoc warning

Exclude certain methods from requiring JSDoc definitions.

Examples

❌  Incorrect

export default {
    methods: {
        updateUser(id, data) {
            return fetch(`/users/${id}`, {
                method: 'POST',
                body: JSON.stringify(opts),
            });
        },
    },
}

✅  Correct

export default {
    methods: {
        /**
         * Update the user with the given id via the API
         *
         * @param {Number} id - id of user
         * @param {Object} data - userdata object
         *
         * @returns {Promise}
         */
        updateUser(id, data) {
            return fetch(`/users/${id}`, {
                method: 'POST',
                body: JSON.stringify(data),
            });
        },
    },
}