From f858c506c1bd9acf8be5736416ec5811e6ba64b3 Mon Sep 17 00:00:00 2001 From: Andrei Dumitrescu <5057797+andreidmt@users.noreply.github.com> Date: Thu, 26 Nov 2020 18:23:53 +0100 Subject: [PATCH] chore: Fix linting errors --- .eslintrc | 3 ++- src/plugins/router.js | 25 +++++++++++++++---------- src/routes/ping.schema.js | 38 -------------------------------------- 3 files changed, 17 insertions(+), 49 deletions(-) diff --git a/.eslintrc b/.eslintrc index d23d730..0f337d4 100644 --- a/.eslintrc +++ b/.eslintrc @@ -13,6 +13,7 @@ } }, "rules": { - "promise/avoid-new": "off" + "promise/avoid-new": "off", + "valid-jsdoc": "off" }, } diff --git a/src/plugins/router.js b/src/plugins/router.js index 239702a..977140c 100644 --- a/src/plugins/router.js +++ b/src/plugins/router.js @@ -38,11 +38,11 @@ module.exports = { /** * Searches for the first match. * - * @param {Object} arg1 Props - * @param {string} arg1.method HTTP method - * @param {string} arg1.pathname URL pathname + * @param {object} arg1 Props + * @param {string} arg1.method HTTP method + * @param {string} arg1.pathname URL pathname * - * @return {Object} + * @returns {object} */ find: ({ method, pathname }) => { const route = findWith( @@ -77,9 +77,14 @@ module.exports = { /** * { function_description } * - * @param {Object} newRoute Route + * @param {object} props + * @param {string} props.method + * @param {string} props.path + * @param {object} props.schema + * @param {Function} props.authenticate + * @param {Function} props.authorize * - * @return {undefined} + * @returns {undefined} */ add: ({ method = "GET", @@ -115,11 +120,11 @@ module.exports = { /** * { function_description } * - * @param {Object} arg1 The argument 1 - * @param {Object} arg1.route The route - * @param {Object} arg1.req The request + * @param {object} arg1 The argument 1 + * @param {object} arg1.route The route + * @param {object} arg1.req The request * - * @return {Object} + * @returns {object} */ answer: ({ route, req }) => { // Input validation check diff --git a/src/routes/ping.schema.js b/src/routes/ping.schema.js index aee6060..d4e23f6 100644 --- a/src/routes/ping.schema.js +++ b/src/routes/ping.schema.js @@ -1,41 +1,3 @@ -/** - * foo: { - * type: "string", - * pattern: "^[a-z0-9-]+$", - * maxLength: 25, - * minLength: 25, - * }, - * - * limit: { - * type: "integer", - * minimum: 1, - * maximum: 100, - * default: 20, - * }, - * - * bar: { - * type: "string", - * enum: ["lorem", "dolor", "bobby"], - * }, - * - * ipsum: { - * type: ["integer", "null"], - * enum: ["lorem", "dolor", "bobby"], - * }, - * - * id: { - * oneOf: [ - * { type: "integer" }, - * { - * type: "array", - * items: { type: "integer" }, - * minItems: 1, - * uniqueItems: true, - * }, - * ], - * }, - */ - module.exports = { headers: { type: "object",