Skip to content

Feat/guard clause

Feat/guard clause #28

GitHub Actions / Lint failed Jan 8, 2025

Errors 149, Warnings 1

Found 149 errors and 1 warnings

Annotations

Check failure on line 2 in packages/logger/src/logger.configuration.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/consistent-type-imports): All imports in the declaration are only used as types. Use `import type`.

All imports in the declaration are only used as types. Use `import type`.
Raw output
> 1 | import { LoggerOptions }         from 'pino'
    | ^
  2 | import { Logger }                from 'pino'
  3 | import pino                      from 'pino'
  4 |

Check failure on line 3 in packages/logger/src/logger.configuration.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/consistent-type-imports): All imports in the declaration are only used as types. Use `import type`.

All imports in the declaration are only used as types. Use `import type`.
Raw output
  1 | import { LoggerOptions }         from 'pino'
> 2 | import { Logger }                from 'pino'
    | ^
  3 | import pino                      from 'pino'
  4 |
  5 | import { Severity }              from './logger.interfaces'

Check failure on line 7 in packages/logger/src/logger.configuration.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/consistent-type-imports): All imports in the declaration are only used as types. Use `import type`.

All imports in the declaration are only used as types. Use `import type`.
Raw output
  4 |
  5 | import { Severity }              from './logger.interfaces'
> 6 | import { SeverityKind }          from './logger.interfaces'
    | ^
  7 | import { CloudLoggingFormatter } from './transport'
  8 |
  9 | export class Configuration {

Check failure on line 11 in packages/logger/src/logger.configuration.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/array-type): Array type using 'string[]' is forbidden. Use 'Array<string>' instead.

Array type using 'string[]' is forbidden. Use 'Array<string>' instead.
Raw output
   8 |
   9 | export class Configuration {
> 10 |   debug?: string[]
     |           ^
  11 |
  12 |   severity: SeverityKind
  13 |

Check failure on line 41 in packages/logger/src/logger.configuration.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/explicit-function-return-type): Missing return type on function.

Missing return type on function.
Raw output
  38 |   }
  39 |
> 40 |   getSeverity(name?: string) {
     |   ^
  41 |     if (this.debug && name && this.debug.includes(name)) {
  42 |       return Severity.DEBUG
  43 |     }

Check failure on line 41 in packages/logger/src/logger.configuration.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/explicit-module-boundary-types): Missing return type on function.

Missing return type on function.
Raw output
  38 |   }
  39 |
> 40 |   getSeverity(name?: string) {
     |   ^
  41 |     if (this.debug && name && this.debug.includes(name)) {
  42 |       return Severity.DEBUG
  43 |     }

Check failure on line 49 in packages/logger/src/logger.configuration.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/explicit-function-return-type): Missing return type on function.

Missing return type on function.
Raw output
  46 |   }
  47 |
> 48 |   setDebug(debug: string) {
     |   ^
  49 |     this.debug = debug.split(',')
  50 |   }
  51 | }

Check failure on line 49 in packages/logger/src/logger.configuration.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/explicit-module-boundary-types): Missing return type on function.

Missing return type on function.
Raw output
  46 |   }
  47 |
> 48 |   setDebug(debug: string) {
     |   ^
  49 |     this.debug = debug.split(',')
  50 |   }
  51 | }

Check failure on line 3 in packages/logger/src/logger.interfaces.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/sort-type-constituents): Union type AttributeValue constituents must be sorted.

Union type AttributeValue constituents must be sorted.
Raw output
  1 | export type AttributeValue =
> 2 |   | string
    |   ^
  3 |   | number
  4 |   | boolean
  5 |   | Array<null | undefined | string>

Check failure on line 6 in packages/logger/src/logger.interfaces.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/sort-type-constituents): Union type constituents must be sorted.

Union type constituents must be sorted.
Raw output
  3 |   | number
  4 |   | boolean
> 5 |   | Array<null | undefined | string>
    |           ^
  6 |   | Array<null | undefined | number>
  7 |   | Array<null | undefined | boolean>
  8 |

Check failure on line 7 in packages/logger/src/logger.interfaces.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/sort-type-constituents): Union type constituents must be sorted.

Union type constituents must be sorted.
Raw output
  4 |   | boolean
  5 |   | Array<null | undefined | string>
> 6 |   | Array<null | undefined | number>
    |           ^
  7 |   | Array<null | undefined | boolean>
  8 |
  9 | export interface Attributes {

Check failure on line 8 in packages/logger/src/logger.interfaces.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/sort-type-constituents): Union type constituents must be sorted.

Union type constituents must be sorted.
Raw output
   5 |   | Array<null | undefined | string>
   6 |   | Array<null | undefined | number>
>  7 |   | Array<null | undefined | boolean>
     |           ^
   8 |
   9 | export interface Attributes {
  10 |   [attributeKey: string]: AttributeValue | undefined

Check failure on line 10 in packages/logger/src/logger.interfaces.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/consistent-indexed-object-style): A record is preferred over an index signature.

A record is preferred over an index signature.
Raw output
   7 |   | Array<null | undefined | boolean>
   8 |
>  9 | export interface Attributes {
     |        ^
  10 |   [attributeKey: string]: AttributeValue | undefined
  11 | }
  12 |

Check failure on line 14 in packages/logger/src/logger.interfaces.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/consistent-indexed-object-style): A record is preferred over an index signature.

A record is preferred over an index signature.
Raw output
  11 | }
  12 |
> 13 | export type BodyData = { [key: string]: any }
     |                        ^
  14 |
  15 | export type Body = string | Error | BodyData | any
  16 |

Check failure on line 14 in packages/logger/src/logger.interfaces.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-explicit-any): Unexpected any. Specify a different type.

Unexpected any. Specify a different type.
Raw output
  11 | }
  12 |
> 13 | export type BodyData = { [key: string]: any }
     |                                         ^
  14 |
  15 | export type Body = string | Error | BodyData | any
  16 |

Check failure on line 16 in packages/logger/src/logger.interfaces.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/sort-type-constituents): Union type Body constituents must be sorted.

Union type Body constituents must be sorted.
Raw output
  13 | export type BodyData = { [key: string]: any }
  14 |
> 15 | export type Body = string | Error | BodyData | any
     |                    ^
  16 |
  17 | export type SeverityNumber = number
  18 |

Check failure on line 16 in packages/logger/src/logger.interfaces.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-explicit-any): Unexpected any. Specify a different type.

Unexpected any. Specify a different type.
Raw output
  13 | export type BodyData = { [key: string]: any }
  14 |
> 15 | export type Body = string | Error | BodyData | any
     |                                                ^
  16 |
  17 | export type SeverityNumber = number
  18 |

Check failure on line 16 in packages/logger/src/logger.interfaces.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-redundant-type-constituents): 'any' overrides all other types in this union type.

'any' overrides all other types in this union type.
Raw output
  13 | export type BodyData = { [key: string]: any }
  14 |
> 15 | export type Body = string | Error | BodyData | any
     |                                                ^
  16 |
  17 | export type SeverityNumber = number
  18 |

Check warning on line 20 in packages/logger/src/logger.interfaces.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(unknown): Unused eslint-disable directive (no problems were reported from 'no-shadow').

Unused eslint-disable directive (no problems were reported from 'no-shadow').
Raw output
  17 | export type SeverityNumber = number
  18 |
> 19 | // eslint-disable-next-line no-shadow
     | ^
  20 | export enum SeverityName {
  21 |   TRACE = 'TRACE',
  22 |   DEBUG = 'DEBUG',

Check failure on line 78 in packages/logger/src/logger.interfaces.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-explicit-any): Unexpected any. Specify a different type.

Unexpected any. Specify a different type.
Raw output
  75 |   body: Body
  76 |   attributes?: Attributes
> 77 |   resource?: any
     |              ^
  78 | }
  79 |

Check failure on line 9 in packages/logger/src/logger.test.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unsafe-call): Unsafe call of a(n) `error` type typed value.

Unsafe call of a(n) `error` type typed value.
Raw output
   6 | import { configuration } from './logger.configuration'
   7 |
>  8 | describe('logger', () => {
     | ^
   9 |   afterEach(() => {
  10 |     jest.clearAllMocks()
  11 |   })

Check failure on line 10 in packages/logger/src/logger.test.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unsafe-call): Unsafe call of a(n) `error` type typed value.

Unsafe call of a(n) `error` type typed value.
Raw output
   7 |
   8 | describe('logger', () => {
>  9 |   afterEach(() => {
     |   ^
  10 |     jest.clearAllMocks()
  11 |   })
  12 |

Check failure on line 11 in packages/logger/src/logger.test.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unsafe-call): Unsafe call of a(n) `error` type typed value.

Unsafe call of a(n) `error` type typed value.
Raw output
   8 | describe('logger', () => {
   9 |   afterEach(() => {
> 10 |     jest.clearAllMocks()
     |     ^
  11 |   })
  12 |
  13 |   it('log body', () => {

Check failure on line 14 in packages/logger/src/logger.test.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unsafe-call): Unsafe call of a(n) `error` type typed value.

Unsafe call of a(n) `error` type typed value.
Raw output
  11 |   })
  12 |
> 13 |   it('log body', () => {
     |   ^
  14 |     const log = jest.spyOn(configuration.transport, 'info').mockImplementation(() => undefined)
  15 |
  16 |     new Logger().info('test')

Check failure on line 15 in packages/logger/src/logger.test.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unsafe-call): Unsafe call of a(n) `error` type typed value.

Unsafe call of a(n) `error` type typed value.
Raw output
  12 |
  13 |   it('log body', () => {
> 14 |     const log = jest.spyOn(configuration.transport, 'info').mockImplementation(() => undefined)
     |                 ^
  15 |
  16 |     new Logger().info('test')
  17 |