From 15976e906abc23a4d1c28b5829ed0f809b1925c9 Mon Sep 17 00:00:00 2001 From: Alys Date: Sat, 8 Feb 2020 16:06:00 +1000 Subject: [PATCH] apply eslint-disable max-len around block comments that need to have a long line The `@api ` lines can't have a line break in them because it would cause the first part of the text to not be displayed on the apidocs website. Using `// eslint-disable-line max-len` at the end of an `@api ` line doesn't work, possibly because it's nesting a comment inside a multi-line comment. The only way I've found to ignore the `max-len` rule is to put disable and enable comments around the whole comment block. --- website/server/controllers/api-v3/tasks/groups.js | 2 ++ website/server/controllers/api-v3/user.js | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/website/server/controllers/api-v3/tasks/groups.js b/website/server/controllers/api-v3/tasks/groups.js index 77d44dd587..4834993a68 100644 --- a/website/server/controllers/api-v3/tasks/groups.js +++ b/website/server/controllers/api-v3/tasks/groups.js @@ -111,6 +111,7 @@ api.getGroupTasks = { }, }; +/* eslint-disable max-len */ /** * @api {post} /api/v3/group/:groupId/tasks/:taskId/move/to/:position Move group task to new position * @apiDescription Moves a group task to a specified position @@ -124,6 +125,7 @@ api.getGroupTasks = { * * @apiSuccess {Array} data The new tasks order (group.tasksOrder.{task.type}s) */ +/* eslint-enable max-len */ api.groupMoveTask = { method: 'POST', url: '/group-tasks/:taskId/move/to/:position', diff --git a/website/server/controllers/api-v3/user.js b/website/server/controllers/api-v3/user.js index f464f4aae8..1d779d5fef 100644 --- a/website/server/controllers/api-v3/user.js +++ b/website/server/controllers/api-v3/user.js @@ -1671,8 +1671,9 @@ api.togglePinnedItem = { }, }; +/* eslint-disable max-len */ /** - * @api {post} /api/v3/user/move-pinned-item/:type/:path/move/to/:position Move a pinned item in the rewards column to a new position after being sorted // eslint-disable-line max-len + * @api {post} /api/v3/user/move-pinned-item/:type/:path/move/to/:position Move a pinned item in the rewards column to a new position after being sorted * @apiName MovePinnedItem * @apiGroup User * @@ -1689,6 +1690,7 @@ api.togglePinnedItem = { * * @apiUse TaskNotFound */ +/* eslint-enable max-len */ api.movePinnedItem = { method: 'POST', url: '/user/move-pinned-item/:path/move/to/:position',