Skip to content

Commit

Permalink
Update code-standard-preset and fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
LindvedKrvang committed Jul 1, 2024
1 parent 002a02c commit 5d5173c
Show file tree
Hide file tree
Showing 3 changed files with 469 additions and 265 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"xml2js": "^0.6.2"
},
"devDependencies": {
"@sofie-automation/code-standard-preset": "^2.0.2",
"@sofie-automation/code-standard-preset": "^2.5.2",
"@types/jest": "^29.5.12",
"@types/koa": "^2.11.6",
"@types/koa-bodyparser": "^4.3.0",
Expand Down
10 changes: 5 additions & 5 deletions src/peptalk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export interface IInexistentError extends PepError {
}

export class InexistentError extends PepError implements IInexistentError {
readonly status: 'inexistent' = 'inexistent'
readonly status = 'inexistent' as const
readonly path: string
constructor(id: number, path: string, sent?: string) {
super('inexistent', id, `PepTalk inexistent error: Could not locate element at ${path}.`, sent)
Expand All @@ -106,7 +106,7 @@ export interface IInvalidError extends PepError {
}

export class InvalidError extends PepError implements IInvalidError {
readonly status: 'invalid' = 'invalid'
readonly status = 'invalid' as const
readonly description: string
constructor(id: number, description: string, sent?: string) {
super('invalid', id, `Validation error: ${description}.`, sent)
Expand All @@ -123,7 +123,7 @@ export interface INotAllowedError extends PepError {
}

export class NotAllowedError extends PepError implements INotAllowedError {
readonly status: 'not_allowed' = 'not_allowed'
readonly status = 'not_allowed' as const
readonly reason: string
constructor(id: number, reason: string, sent?: string) {
super('not_allowed', id, `Request understood put not allowed: ${reason}.`, sent)
Expand All @@ -140,7 +140,7 @@ export interface ISyntaxError extends PepError {
}

export class SyntaxError extends PepError implements ISyntaxError {
readonly status: 'syntax' = 'syntax'
readonly status = 'syntax' as const
readonly description: string
constructor(id: number, description: string, sent?: string) {
super('syntax', id, `Syntax error in request: ${description}.`, sent)
Expand All @@ -158,7 +158,7 @@ export interface IUnspecifiedError extends PepError {

export class UnspecifiedError extends PepError implements IUnspecifiedError {
readonly description: string
readonly status: 'unspecified' = 'unspecified'
readonly status = 'unspecified' as const
constructor(id: number | '*', description: string, sent?: string) {
super('unspecified', id, description, sent)
this.description = description
Expand Down
Loading

0 comments on commit 5d5173c

Please sign in to comment.