Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix linting issues #58

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"prepare": "husky install",
"clean": "rimraf dist",
"prepublishOnly": "npm run clean && tsc -b tsconfig.build.json",
"lint": "eslint -c .eslintrc.js --ext .ts src",
"lint": "eslint -c .eslintrc.js --ext .ts src --fix",
"lint:all": "npm run lint && cd demo && npm run lint",
"prepack": "npm run lint && npm run prepublishOnly",
"test": "jest",
Expand Down
4 changes: 2 additions & 2 deletions src/lib/utils/example-content.util.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { HttpException } from '@nestjs/common';
import { ContentObject } from '@nestjs/swagger/dist/interfaces/open-api-spec.interface';

import { buildPlaceholder } from '../builder/placeholder.builder';
import { MergedOptions, Placeholder, Template } from '../interfaces/options.interface';
import { merge } from './example.util';

Check failure on line 4 in src/lib/utils/example-content.util.ts

View workflow job for this annotation

GitHub Actions / SonarCloud

`../builder/placeholder.builder` import should occur after import of `./type.util`

Check failure on line 4 in src/lib/utils/example-content.util.ts

View workflow job for this annotation

GitHub Actions / SonarCloud

`../builder/placeholder.builder` import should occur after import of `./type.util`
import { buildSchema } from './schema.util';

Check failure on line 5 in src/lib/utils/example-content.util.ts

View workflow job for this annotation

GitHub Actions / SonarCloud

`../interfaces/options.interface` import should occur after import of `./type.util`

Check failure on line 5 in src/lib/utils/example-content.util.ts

View workflow job for this annotation

GitHub Actions / SonarCloud

`../interfaces/options.interface` import should occur after import of `./type.util`
import { buildMessageByType } from './type.util';
import { buildPlaceholder } from '../builder/placeholder.builder';
import { MergedOptions, Placeholder, Template } from '../interfaces/options.interface';

const PLACEHOLDER_IDENTIFIER = '$';
const isPlaceholder = (value: unknown): value is string =>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/schema.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import { getTypeIsArrayTuple } from '@nestjs/swagger/dist/decorators/helpers';
import { ReferenceObject, SchemaObject } from '@nestjs/swagger/dist/interfaces/open-api-spec.interface';

import { MergedOptions, Options } from '../interfaces/options.interface';
import { resolveTemplatePlaceholders } from './example-content.util';

Check failure on line 6 in src/lib/utils/schema.util.ts

View workflow job for this annotation

GitHub Actions / SonarCloud

`../interfaces/options.interface` import should occur after import of `./options.util`

Check failure on line 6 in src/lib/utils/schema.util.ts

View workflow job for this annotation

GitHub Actions / SonarCloud

`../interfaces/options.interface` import should occur after import of `./options.util`
import { DefaultTemplateRequiredProperties } from './options.util';
import { MergedOptions, Options } from '../interfaces/options.interface';

type SchemaOrReference = SchemaObject | ReferenceObject;

Expand Down
2 changes: 1 addition & 1 deletion src/test/decorators/api-exception.decorator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import { ApiOperation, ApiOperationOptions, ApiResponse, ApiResponseOptions } from '@nestjs/swagger';
import { DECORATORS } from '@nestjs/swagger/dist/constants';

import { ApiException, buildPlaceholder, buildTemplatedApiExceptionDecorator } from '../../lib';
import { BaseException, ExceptionWithoutError, UserUnauthorizedException } from './exceptions/BaseException';

Check failure on line 7 in src/test/decorators/api-exception.decorator.spec.ts

View workflow job for this annotation

GitHub Actions / SonarCloud

`../../lib` import should occur after import of `./type/swagger-annotation.type`

Check failure on line 7 in src/test/decorators/api-exception.decorator.spec.ts

View workflow job for this annotation

GitHub Actions / SonarCloud

`../../lib` import should occur after import of `./type/swagger-annotation.type`
import { BaseExceptionType } from './type/base-exception.type';
import { SwaggerAnnotations } from './type/swagger-annotation.type';
import { ApiException, buildPlaceholder, buildTemplatedApiExceptionDecorator } from '../../lib';

const TemplatedApiException = buildTemplatedApiExceptionDecorator({
statusCode: '$status',
Expand Down
6 changes: 5 additions & 1 deletion src/test/decorators/exceptions/BaseException.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { HttpException, HttpStatus } from '@nestjs/common';

export class BaseException extends HttpException {
constructor(response: string | Record<string, any>, status: number, private clientCode: number) {
constructor(

Check failure on line 4 in src/test/decorators/exceptions/BaseException.ts

View workflow job for this annotation

GitHub Actions / SonarCloud

Replace `response:·string·|·Record<string,·any>,·status:·number,·private·clientCode:·number` with `⏎····response:·string·|·Record<string,·any>,⏎····status:·number,⏎····private·clientCode:·number,⏎··`

Check failure on line 4 in src/test/decorators/exceptions/BaseException.ts

View workflow job for this annotation

GitHub Actions / SonarCloud

Replace `response:·string·|·Record<string,·any>,·status:·number,·private·clientCode:·number` with `⏎····response:·string·|·Record<string,·any>,⏎····status:·number,⏎····private·clientCode:·number,⏎··`
response: string | Record<string, any>,
status: number,
private clientCode: number,
) {
super(response, status);
}

Expand Down
Loading