From 3e59aa4b55905831e397de09e95a6610a98bdb5d Mon Sep 17 00:00:00 2001 From: Joachim Van Herwegen Date: Wed, 13 Mar 2024 16:50:02 +0100 Subject: [PATCH] refactor: Enable jsdoc/valid-types rule --- eslint/general.js | 1 + src/storage/mapping/BaseFileIdentifierMapper.ts | 4 ++-- src/util/HeaderUtil.ts | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/eslint/general.js b/eslint/general.js index 099e57121..5e39dab2e 100644 --- a/eslint/general.js +++ b/eslint/general.js @@ -53,6 +53,7 @@ module.exports = { 'jsdoc/no-multi-asterisks': [ 'error', { allowWhitespace: true }], 'jsdoc/no-types': 'error', + 'jsdoc/valid-types': 'error', 'node/prefer-global/buffer': [ 'error', 'always' ], 'node/prefer-global/console': [ 'error', 'always' ], diff --git a/src/storage/mapping/BaseFileIdentifierMapper.ts b/src/storage/mapping/BaseFileIdentifierMapper.ts index 5f533b8a5..a5440afec 100644 --- a/src/storage/mapping/BaseFileIdentifierMapper.ts +++ b/src/storage/mapping/BaseFileIdentifierMapper.ts @@ -177,7 +177,7 @@ export class BaseFileIdentifierMapper implements FileIdentifierMapper { * Strips the baseRequestURI from the identifier. * @param identifier - Incoming identifier. * - * @throws {@link NotFoundHttpError} + * @throws NotFoundHttpError * If the identifier does not match the baseRequestURI. * * @returns A string representing the relative path. @@ -193,7 +193,7 @@ export class BaseFileIdentifierMapper implements FileIdentifierMapper { /** * Check if the given relative path is valid. * - * @throws {@link BadRequestHttpError} + * @throws BadRequestHttpError * If the relative path is invalid. * * @param path - A relative path, as generated by {@link getRelativePath}. diff --git a/src/util/HeaderUtil.ts b/src/util/HeaderUtil.ts index 91df306f6..5c9ea8ffd 100644 --- a/src/util/HeaderUtil.ts +++ b/src/util/HeaderUtil.ts @@ -31,7 +31,7 @@ const logger = getLoggerFor('HeaderUtil'); * Replaces all double quoted strings in the input string with `"0"`, `"1"`, etc. * @param input - The Accept header string. * - * @throws {@link BadRequestHttpError} + * @throws BadRequestHttpError * Thrown if invalid characters are detected in a quoted string. * * @returns The transformed string and a map with keys `"0"`, etc. and values the original string that was there. @@ -371,7 +371,7 @@ export function addHeader(response: HttpResponse, name: string, value: string | * * @param input - The Content-Type header string. * - * @throws {@link BadRequestHttpError} + * @throws BadRequestHttpError * Thrown on invalid header syntax. * * @returns A {@link ContentType} object containing the value and optional parameters.