Skip to content

Commit 3a62daf

Browse files
committed
chore: fix lint errors
Signed-off-by: Vladislav Polyakov <polrk@ydb.tech>
1 parent b198254 commit 3a62daf

File tree

4 files changed

+21
-17
lines changed

4 files changed

+21
-17
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"search.exclude": {
1313
"**/vitest/dist": true
1414
},
15+
"oxc.enable": true,
1516
"vitest.rootConfig": "./vitest.config.ts",
1617
"vitest.workspaceConfig": "./vitest.config.ts",
1718
"github.copilot.chat.codeGeneration.useInstructionFiles": true,

packages/query/src/query.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export class Query<T extends any[] = unknown[]> extends EventEmitter<QueryEventM
7575
this.#parameters = {}
7676

7777
for (let key in params) {
78+
// oxlint-disable no-unused-expressions
7879
key.startsWith('$') || (key = '$' + key)
7980
this.#parameters[key] = params[key]!
8081
}
@@ -305,6 +306,7 @@ export class Query<T extends any[] = unknown[]> extends EventEmitter<QueryEventM
305306
let queryText = this.#text
306307
if (this.#parameters) {
307308
for (let [name, value] of Object.entries(this.#parameters)) {
309+
// oxlint-disable no-unused-expressions
308310
name.startsWith('$') || (name = '$' + name)
309311

310312
queryText = `DECLARE ${name} AS ${typeToString(value.type)};\n` + queryText

packages/query/src/yql.test.ts

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ test('handles falsy values', () => {
9797

9898
test('throws detailed error for undefined value', () => {
9999
try {
100+
// oxlint-disable-next-line no-unassigned-vars
100101
let undefinedVar: any
101-
yql`SELECT ${undefinedVar};`
102+
void yql`SELECT ${undefinedVar};`
102103
expect.fail('Should have thrown')
103104
} catch (error: any) {
104105
expect(error.message).toContain('position 0')
@@ -110,7 +111,7 @@ test('throws detailed error for undefined value', () => {
110111

111112
test('throws detailed error for null value', () => {
112113
try {
113-
yql`SELECT ${42}, ${null}, ${true};`
114+
void yql`SELECT ${42}, ${null}, ${true};`
114115
expect.fail('Should have thrown')
115116
} catch (error: any) {
116117
expect(error.message).toContain('position 1') // null is at position 1
@@ -145,32 +146,32 @@ test('handles mixed unsafe and safe values', () => {
145146
})
146147

147148
test('creates identifier unsafe string', () => {
148-
let id = identifier('my_table')
149+
let id = identifier('my_table')
149150

150-
expect(id.toString()).eq('`my_table`')
151-
expect(id).toBeInstanceOf(String)
151+
expect(id.toString()).eq('`my_table`')
152+
expect(id).toBeInstanceOf(String)
152153
})
153154

154155
test('creates unsafe string', () => {
155-
let raw = unsafe('RAW SQL')
156+
let raw = unsafe('RAW SQL')
156157

157-
expect(raw.toString()).eq('RAW SQL')
158-
expect(raw).toBeInstanceOf(String)
158+
expect(raw.toString()).eq('RAW SQL')
159+
expect(raw).toBeInstanceOf(String)
159160
})
160161

161162
test('identifier escapes backticks inside names', () => {
162-
let id = identifier('my`table')
163+
let id = identifier('my`table')
163164

164-
expect(id.toString()).eq('`my``table`')
165+
expect(id.toString()).eq('`my``table`')
165166
})
166167

167168
test('public exports identifier/unsafe behave correctly', async () => {
168-
// Import from public entry to ensure re-exports work in tests
169-
const { identifier: pubIdentifier, unsafe: pubUnsafe } = await import('./index.ts')
169+
// Import from public entry to ensure re-exports work in tests
170+
const { identifier: pubIdentifier, unsafe: pubUnsafe } = await import('./index.ts')
170171

171-
expect(pubIdentifier('users').toString()).eq('`users`')
172-
expect(pubIdentifier('a`b').toString()).eq('`a``b`')
173-
expect(pubUnsafe('ORDER BY created_at DESC').toString()).eq('ORDER BY created_at DESC')
172+
expect(pubIdentifier('users').toString()).eq('`users`')
173+
expect(pubIdentifier('a`b').toString()).eq('`a``b`')
174+
expect(pubUnsafe('ORDER BY created_at DESC').toString()).eq('ORDER BY created_at DESC')
174175
})
175176

176177
test('handles various data types', () => {
@@ -210,7 +211,7 @@ test('handles unsafe values at boundaries', () => {
210211

211212
test('validates all parameters and reports first error', () => {
212213
try {
213-
yql`SELECT ${undefined}, ${null};` // both are invalid
214+
void yql`SELECT ${undefined}, ${null};` // both are invalid
214215
expect.fail('Should have thrown')
215216
} catch (error: any) {
216217
// Should catch the first error (undefined at position 0)

packages/retry/src/retry-errors.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { StatusIds_StatusCode } from '@ydbjs/api/operation'
33
import { CommitError, YDBError } from '@ydbjs/error'
44
import { ClientError, Status } from 'nice-grpc'
55

6-
import { isRetryableError, defaultRetryConfig } from './index.ts'
6+
import { defaultRetryConfig, isRetryableError } from './index.ts'
77

88
// Tests for isRetryableError function
99
test('ClientError with ABORTED is retryable', () => {

0 commit comments

Comments
 (0)