diff --git a/backend/.eslintrc.json b/backend/.eslintrc.json index 8aabb955f..6089815ec 100644 --- a/backend/.eslintrc.json +++ b/backend/.eslintrc.json @@ -8,9 +8,13 @@ "plugin:@typescript-eslint/recommended" ], "rules": { - "@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }], + "@typescript-eslint/no-unused-vars": [ + "warn", + { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_", "caughtErrorsIgnorePattern": "^_" } + ], "@typescript-eslint/no-extra-semi": "off", "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unused-expressions": ["off", { "allowTernary": true }], "simple-import-sort/imports": "warn", "simple-import-sort/exports": "warn", "no-console": "warn" diff --git a/backend/src/clients/cognito.ts b/backend/src/clients/cognito.ts index 4def2fe0a..927f36148 100644 --- a/backend/src/clients/cognito.ts +++ b/backend/src/clients/cognito.ts @@ -14,7 +14,7 @@ export async function listUsers(query: string, exactMatch = false) { try { dnName = config.oauth.cognito.userIdAttribute userPoolId = config.oauth.cognito.userPoolId - } catch (e) { + } catch (_e) { throw ConfigurationError('Cannot find userIdAttribute in oauth configuration', { oauthConfiguration: config.oauth }) } diff --git a/backend/src/connectors/fileScanning/clamAv.ts b/backend/src/connectors/fileScanning/clamAv.ts index 6f2b9f364..c56368725 100644 --- a/backend/src/connectors/fileScanning/clamAv.ts +++ b/backend/src/connectors/fileScanning/clamAv.ts @@ -27,7 +27,7 @@ export class ClamAvFileScanningConnector extends BaseFileScanningConnector { try { av = await new NodeClam().init({ clamdscan: config.avScanning.clamdscan }) log.info('Clam AV initialised.') - } catch (error) { + } catch (_error) { log.warn(`Could not initialise Clam AV, retrying (attempt ${retryCount})...`) this.init(++retryCount) } diff --git a/backend/src/connectors/fileScanning/index.ts b/backend/src/connectors/fileScanning/index.ts index d4f373879..a6cf587f2 100644 --- a/backend/src/connectors/fileScanning/index.ts +++ b/backend/src/connectors/fileScanning/index.ts @@ -24,7 +24,7 @@ export function runFileScanners(cache = true) { const scanner = new ClamAvFileScanningConnector() await scanner.init() fileScanConnectors.push(scanner) - } catch (error) { + } catch (_error) { throw ConfigurationError('Could not configure or initialise Clam AV') } break @@ -33,7 +33,7 @@ export function runFileScanners(cache = true) { const scanner = new ModelScanFileScanningConnector() await scanner.init() fileScanConnectors.push(scanner) - } catch (error) { + } catch (_error) { throw ConfigurationError('Could not configure or initialise ModelScan') } break diff --git a/backend/src/connectors/fileScanning/modelScan.ts b/backend/src/connectors/fileScanning/modelScan.ts index 2a6437934..e00af3cec 100644 --- a/backend/src/connectors/fileScanning/modelScan.ts +++ b/backend/src/connectors/fileScanning/modelScan.ts @@ -26,7 +26,7 @@ export class ModelScanFileScanningConnector extends BaseFileScanningConnector { try { await getModelScanInfo() log.info('ModelScan initialised.') - } catch (error) { + } catch (_error) { log.warn(`Could not initialise ModelScan, retrying (attempt ${retryCount})...`) this.init(++retryCount) } diff --git a/backend/src/migrations/011_find_and_remove_invalid_users.ts b/backend/src/migrations/011_find_and_remove_invalid_users.ts index a0fa6970d..25c05ccb6 100644 --- a/backend/src/migrations/011_find_and_remove_invalid_users.ts +++ b/backend/src/migrations/011_find_and_remove_invalid_users.ts @@ -20,7 +20,7 @@ export async function up() { if (collaborator.entity !== '') { try { await authentication.getUserInformation(collaborator.entity) - } catch (err) { + } catch (_err) { invalidUsers.push(collaborator.entity) } }