chore: strengthen backend eslint profile

This commit is contained in:
2026-09-28 16:37:01 +03:00
committed by ksv741
parent 53b2794963
commit a970eaaf7a
179 changed files with 4485 additions and 2716 deletions
@@ -1,7 +1,8 @@
import { HttpStatus, applyDecorators } from '@nestjs/common';
import { applyDecorators, HttpStatus } from '@nestjs/common';
import {
ApiExtraModels,
ApiProperty,
ApiPropertyOptional,
ApiResponse,
getSchemaPath,
} from '@nestjs/swagger';
@@ -13,8 +14,8 @@ export class ProblemDetailsDto {
@ApiProperty({ example: 'UNAUTHORIZED' })
declare code: string;
@ApiProperty({
required: false,
// eslint-disable-next-line @darraghor/nestjs-typed/api-property-returning-array-should-set-array -- Raw OpenAPI items schema already declares type: array.
@ApiPropertyOptional({
type: 'array',
items: {
type: 'object',
@@ -23,7 +24,7 @@ export class ProblemDetailsDto {
},
example: [{ pointer: '#/email', detail: 'must be a valid email address' }],
})
errors?: { pointer: string; detail: string }[];
errors?: { detail: string; pointer: string }[];
}
function problemResponse(status: number, description: string) {
@@ -38,7 +39,7 @@ function problemResponse(status: number, description: string) {
});
}
export function ApiProblemResponses(): MethodDecorator & ClassDecorator {
export function ApiProblemResponses(): ClassDecorator & MethodDecorator {
return applyDecorators(
ApiExtraModels(ProblemDetailsDto),
problemResponse(HttpStatus.BAD_REQUEST, 'Invalid request'),