From b95bfb7689f22529167fc00d46f2c2136540d61e Mon Sep 17 00:00:00 2001 From: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com> Date: Wed, 11 Oct 2023 12:31:00 +0000 Subject: [PATCH] style: apply automated linter fixes --- src/language/helpers/stringUtils.ts | 2 +- .../validation/other/types/namedTypes.ts | 2 +- src/language/validation/safe-ds-validator.ts | 4 ++-- src/language/validation/types.ts | 16 ++++++---------- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/language/helpers/stringUtils.ts b/src/language/helpers/stringUtils.ts index f8d7db190..a2bc03da9 100644 --- a/src/language/helpers/stringUtils.ts +++ b/src/language/helpers/stringUtils.ts @@ -3,4 +3,4 @@ */ export const pluralize = (count: number, singular: string, plural: string = `${singular}s`): string => { return count === 1 ? singular : plural; -} +}; diff --git a/src/language/validation/other/types/namedTypes.ts b/src/language/validation/other/types/namedTypes.ts index 3b82791ef..0a0adfefc 100644 --- a/src/language/validation/other/types/namedTypes.ts +++ b/src/language/validation/other/types/namedTypes.ts @@ -52,7 +52,7 @@ export const namedTypeTypeArgumentListMustNotHavePositionalArgumentsAfterNamedAr export const namedTypeMustNotHaveTooManyTypeArguments = (node: SdsNamedType, accept: ValidationAcceptor): void => { // If the declaration is unresolved, we already show another error if (!node.declaration.ref) { - return + return; } const typeParameters = typeParametersOrEmpty(node.declaration.ref); diff --git a/src/language/validation/safe-ds-validator.ts b/src/language/validation/safe-ds-validator.ts index 39432dac9..a41c4bb9d 100644 --- a/src/language/validation/safe-ds-validator.ts +++ b/src/language/validation/safe-ds-validator.ts @@ -84,8 +84,8 @@ import { singleUseAnnotationsMustNotBeRepeated } from './builtins/repeatable.js' import { namedTypeMustNotHaveTooManyTypeArguments, namedTypeMustNotSetTypeParameterMultipleTimes, - namedTypeTypeArgumentListMustNotHavePositionalArgumentsAfterNamedArguments -} from "./other/types/namedTypes.js"; + namedTypeTypeArgumentListMustNotHavePositionalArgumentsAfterNamedArguments, +} from './other/types/namedTypes.js'; /** * Register custom validation checks. diff --git a/src/language/validation/types.ts b/src/language/validation/types.ts index 9894b19ef..af0ccb477 100644 --- a/src/language/validation/types.ts +++ b/src/language/validation/types.ts @@ -3,7 +3,7 @@ import { isSdsCallable, isSdsLambda, SdsAttribute, SdsNamedType, SdsParameter, S import { typeArgumentsOrEmpty, typeParametersOrEmpty } from '../helpers/nodeProperties.js'; import { isEmpty } from 'radash'; import { SafeDsServices } from '../safe-ds-module.js'; -import {pluralize} from "../helpers/stringUtils.js"; +import { pluralize } from '../helpers/stringUtils.js'; export const CODE_TYPE_MISSING_TYPE_ARGUMENTS = 'type/missing-type-arguments'; export const CODE_TYPE_MISSING_TYPE_HINT = 'type/missing-type-hint'; @@ -30,15 +30,11 @@ export const namedTypeMustSetAllTypeParameters = const kind = pluralize(missingTypeParameters.length, 'type parameter'); const missingTypeParametersString = missingTypeParameters.map((it) => `'${it.name}'`).join(', '); - accept( - 'error', - `The ${kind} ${missingTypeParametersString} must be set here.`, - { - node, - property: 'typeArgumentList', - code: CODE_TYPE_MISSING_TYPE_ARGUMENTS, - }, - ); + accept('error', `The ${kind} ${missingTypeParametersString} must be set here.`, { + node, + property: 'typeArgumentList', + code: CODE_TYPE_MISSING_TYPE_ARGUMENTS, + }); } } else { accept(