Skip to content

Commit d0c0f58

Browse files
committed
refactor(core): linter fixes
1 parent a0b5697 commit d0c0f58

File tree

7 files changed

+16
-17
lines changed

7 files changed

+16
-17
lines changed

packages/core/src/transports/transport.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { CatcherMessage } from '@hawk.so/types';
2-
import type { CatcherMessageType } from '@hawk.so/types';
1+
import type { CatcherMessage, CatcherMessageType } from '@hawk.so/types';
32

43
/**
54
* Transport interface — anything that can send a CatcherMessage

packages/core/src/utils/validation.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
import { log } from '../logger/logger';
22
import type { AffectedUser, Breadcrumb, EventAddons, EventContext, EventData } from '@hawk.so/types';
33

4-
/**
5-
* Returns true if value is a plain object (not null, array, Date, Map, etc.)
6-
*
7-
* @param value - value to check
8-
*/
9-
export function isPlainObject(value: unknown): value is Record<string, unknown> {
10-
return Object.prototype.toString.call(value) === '[object Object]';
11-
}
12-
134
/**
145
* Validates user data - basic security checks
156
*
@@ -47,6 +38,15 @@ export function validateContext(context: EventContext | undefined): boolean {
4738
return true;
4839
}
4940

41+
/**
42+
* Returns true if value is a plain object (not null, array, Date, Map, etc.)
43+
*
44+
* @param value - value to check
45+
*/
46+
export function isPlainObject(value: unknown): value is Record<string, unknown> {
47+
return Object.prototype.toString.call(value) === '[object Object]';
48+
}
49+
5050
/**
5151
* Runtime check for required EventData fields.
5252
* Per @hawk.so/types EventData, `title` is the only non-optional field.

packages/core/tests/modules/sanitizer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, expect } from 'vitest';
1+
import { describe, expect, it } from 'vitest';
22
import { Sanitizer } from '../../src';
33

44
describe('Sanitizer', () => {

packages/core/tests/utils/validation.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { describe, it, expect, vi } from 'vitest';
2-
import { validateUser, validateContext, isValidEventPayload, isValidBreadcrumb } from '../../src';
1+
import { describe, expect, it, vi } from 'vitest';
2+
import { isValidBreadcrumb, isValidEventPayload, validateContext, validateUser } from '../../src';
33

44
// Suppress log output produced by log() calls inside validation failures.
55
vi.mock('../../src/logger/logger', () => ({ log: vi.fn(), isLoggerSet: vi.fn(() => true), setLogger: vi.fn() }));

packages/javascript/src/addons/breadcrumbs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file Breadcrumbs module - captures chronological trail of events before an error
33
*/
44
import type { Breadcrumb, BreadcrumbLevel, BreadcrumbType, Json, JsonNode } from '@hawk.so/types';
5-
import { Sanitizer, buildElementSelector, log, isValidBreadcrumb } from '@hawk.so/core';
5+
import { buildElementSelector, isValidBreadcrumb, log, Sanitizer } from '@hawk.so/core';
66

77
/**
88
* Default maximum number of breadcrumbs to store

packages/javascript/src/types/hawk-initial-settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { EventContext, AffectedUser } from '@hawk.so/types';
1+
import type { AffectedUser, EventContext } from '@hawk.so/types';
22
import type { HawkJavaScriptEvent } from './event';
33
import type { Transport } from '@/types';
44
import type { BreadcrumbsOptions } from '../addons/breadcrumbs';

packages/javascript/tests/modules/sanitizer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, expect } from 'vitest';
1+
import { describe, expect, it } from 'vitest';
22
import { Sanitizer } from '@hawk.so/core';
33
import '../../src/modules/sanitizer';
44

0 commit comments

Comments
 (0)