Skip to content

Commit a5b4f8d

Browse files
authored
chore: Biome 2 (#330)
* Updating deps * Biome config update * Lint fixes
1 parent 7e99e50 commit a5b4f8d

File tree

105 files changed

+455
-504
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+455
-504
lines changed

biome.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
22
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"root": true,
34
"extends": [
4-
"./node_modules/@lokalise/biome-config/configs/biome-base.jsonc",
5-
"./node_modules/@lokalise/biome-config/configs/biome-esm.jsonc",
6-
"./node_modules/@lokalise/biome-config/configs/biome-package.jsonc"
7-
]
5+
"@lokalise/biome-config/configs/biome-base.jsonc",
6+
"@lokalise/biome-config/configs/biome-esm.jsonc",
7+
"@lokalise/biome-config/configs/biome-package.jsonc"
8+
],
9+
"files": {
10+
"includes": ["**", "!.turbo", "!**/dist", "!**/coverage"]
11+
}
812
}

examples/sns-sqs/biome.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/sns-sqs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"zod": "^3.25.7"
2828
},
2929
"devDependencies": {
30-
"@biomejs/biome": "1.9.4",
31-
"@lokalise/biome-config": "^2.0.0",
30+
"@biomejs/biome": "^2.2.0",
31+
"@lokalise/biome-config": "^3.1.0",
3232
"@types/node": "^22.15.19",
3333
"@lokalise/tsconfig": "^1.3.0",
3434
"@vitest/coverage-v8": "^3.1.4",

packages/amqp/lib/AbstractAmqpConsumer.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export abstract class AbstractAmqpConsumer<
9494

9595
this.queueName = options.locatorConfig
9696
? options.locatorConfig.queueName
97-
: // biome-ignore lint/style/noNonNullAssertion: <explanation>
97+
: // biome-ignore lint/style/noNonNullAssertion: Checked by type
9898
options.creationConfig!.queueName
9999

100100
this._messageSchemaContainer = this.resolveConsumerMessageSchemaContainer(options)
@@ -151,14 +151,14 @@ export abstract class AbstractAmqpConsumer<
151151
}
152152
const { originalMessage, parsedMessage } = deserializedMessage.result
153153

154-
// @ts-ignore
154+
// @ts-expect-error
155155
const messageType = parsedMessage[this.messageTypeField]
156156
const transactionSpanId = `queue_${this.queueName}:${
157-
// @ts-ignore
157+
// @ts-expect-error
158158
parsedMessage[this.messageTypeField]
159159
}`
160160

161-
// @ts-ignore
161+
// @ts-expect-error
162162
const uniqueTransactionKey = parsedMessage[this.messageIdField]
163163
this.transactionObservabilityManager?.start(transactionSpanId, uniqueTransactionKey)
164164
if (this.logMessages) {
@@ -349,10 +349,10 @@ export abstract class AbstractAmqpConsumer<
349349
// Empty content for whatever reason
350350
if (!resolvedMessage || !resolvedMessage.body) return ABORT_EARLY_EITHER
351351

352-
// @ts-ignore
352+
// @ts-expect-error
353353
if (this.messageIdField in resolvedMessage.body) {
354354
return {
355-
// @ts-ignore
355+
// @ts-expect-error
356356
result: resolvedMessage.body[this.messageIdField],
357357
}
358358
}

packages/amqp/lib/AbstractAmqpPublisher.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Either } from '@lokalise/node-core'
2-
import { InternalError, copyWithoutUndefined } from '@lokalise/node-core'
2+
import { copyWithoutUndefined, InternalError } from '@lokalise/node-core'
33
import type {
44
BarrierResult,
55
CommonCreationConfigType,
@@ -88,7 +88,7 @@ export abstract class AbstractAmqpPublisher<
8888
}
8989

9090
if (this.logMessages) {
91-
// @ts-ignore
91+
// @ts-expect-error
9292
const resolvedLogMessage = this.resolveMessageLog(message, message[this.messageTypeField])
9393
this.logMessage(resolvedLogMessage)
9494
}
@@ -110,7 +110,7 @@ export abstract class AbstractAmqpPublisher<
110110
// Unfortunately, reliable retry mechanism can't be implemented with try-catch block,
111111
// as not all failures end up here. If connection is closed programmatically, it works fine,
112112
// but if server closes connection unexpectedly (e. g. RabbitMQ is shut down), then we don't land here
113-
// @ts-ignore
113+
// @ts-expect-error
114114
if (err.message === 'Channel closed') {
115115
this.logger.error('AMQP channel closed')
116116
void this.reconnect()
@@ -120,10 +120,10 @@ export abstract class AbstractAmqpPublisher<
120120
errorCode: 'AMQP_PUBLISH_ERROR',
121121
details: copyWithoutUndefined({
122122
publisher: this.constructor.name,
123-
// @ts-ignore
123+
// @ts-expect-error
124124
queueName: this.queueName,
125125
exchange: this.exchange,
126-
// @ts-ignore
126+
// @ts-expect-error
127127
messageType: message[this.messageTypeField] ?? 'unknown',
128128
}),
129129
cause: err as Error,

packages/amqp/lib/AbstractAmqpQueueConsumer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class AbstractAmqpQueueConsumer<
1111
await deleteAmqpQueue(this.channel, this.deletionConfig, this.creationConfig)
1212
}
1313

14-
// biome-ignore lint/style/noNonNullAssertion: <explanation>
14+
// biome-ignore lint/style/noNonNullAssertion: Should be fine
1515
await ensureAmqpQueue(this.connection!, this.channel, this.creationConfig, this.locatorConfig)
1616
}
1717
}

packages/amqp/lib/AbstractAmqpQueuePublisher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export abstract class AbstractAmqpQueuePublisher<
5555
}
5656

5757
protected override createMissingEntities(): Promise<void> {
58-
// biome-ignore lint/style/noNonNullAssertion: <explanation>
58+
// biome-ignore lint/style/noNonNullAssertion: Should be fine
5959
return ensureAmqpQueue(this.connection!, this.channel, this.creationConfig, this.locatorConfig)
6060
}
6161
}

packages/amqp/lib/AbstractAmqpService.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import type {
55
QueueOptions,
66
} from '@message-queue-toolkit/core'
77
import { AbstractQueueService } from '@message-queue-toolkit/core'
8-
import type { Channel, ChannelModel, Message } from 'amqplib'
9-
import type { Options } from 'amqplib'
8+
import type { Channel, ChannelModel, Message, Options } from 'amqplib'
109
import type { AmqpConnectionManager, ConnectionReceiver } from './AmqpConnectionManager.ts'
1110

1211
export type AMQPDependencies = QueueDependencies & {
@@ -61,7 +60,7 @@ export abstract class AbstractAmqpService<
6160
{
6261
protected connection?: ChannelModel
6362
private connectionManager: AmqpConnectionManager
64-
// @ts-ignore
63+
// @ts-expect-error
6564
protected channel: Channel
6665
private isShuttingDown: boolean
6766

@@ -87,7 +86,7 @@ export abstract class AbstractAmqpService<
8786
try {
8887
this.channel = await this.connection.createChannel()
8988
} catch (err) {
90-
// @ts-ignore
89+
// @ts-expect-error
9190
this.logger.error(`Error creating channel: ${err.message}`)
9291
await this.connectionManager.reconnect()
9392
return
@@ -128,7 +127,7 @@ export abstract class AbstractAmqpService<
128127
} catch (_err) {
129128
// We don't care about connection closing errors
130129
} finally {
131-
// @ts-ignore
130+
// @ts-expect-error
132131
this.channel = undefined
133132
}
134133
}

packages/amqp/lib/AbstractAmqpTopicConsumer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class AbstractAmqpTopicConsumer<
1919
}
2020

2121
await ensureAmqpTopicSubscription(
22-
// biome-ignore lint/style/noNonNullAssertion: <explanation>
22+
// biome-ignore lint/style/noNonNullAssertion: Should be fine
2323
this.connection!,
2424
this.channel,
2525
this.creationConfig,

packages/amqp/lib/AbstractAmqpTopicPublisher.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ export abstract class AbstractAmqpTopicPublisher<
4848
message: Buffer,
4949
options: Omit<AmqpTopicMessageOptions, 'routingKey'> & { routingKey: string },
5050
): void {
51-
// biome-ignore lint/style/noNonNullAssertion: <explanation>
51+
// biome-ignore lint/style/noNonNullAssertion: Should be fine
5252
this.channel.publish(this.exchange!, options.routingKey, message, options.publishOptions)
5353
}
5454

5555
protected override resolveTopicOrQueue(): string {
56-
// biome-ignore lint/style/noNonNullAssertion: <explanation>
56+
// biome-ignore lint/style/noNonNullAssertion: Should be fine
5757
return this.exchange!
5858
}
5959

6060
protected override async createMissingEntities(): Promise<void> {
61-
// biome-ignore lint/style/noNonNullAssertion: <explanation>
61+
// biome-ignore lint/style/noNonNullAssertion: Should be fine
6262
await ensureExchange(this.connection!, this.channel, this.creationConfig, this.locatorConfig)
6363
}
6464
}

0 commit comments

Comments
 (0)