Skip to content

Commit 525a537

Browse files
committed
Fix linting errors
- Organize imports in correct alphabetical order - Fix formatting for better readability
1 parent 5e7b6b5 commit 525a537

File tree

6 files changed

+29
-12
lines changed

6 files changed

+29
-12
lines changed

scripts/cover.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*/
55

66
import path from 'node:path'
7-
import { parseArgs } from 'node:util'
87
import { fileURLToPath } from 'node:url'
8+
import { parseArgs } from 'node:util'
99

1010
import { printError, printHeader, printSuccess } from './utils/cli-helpers.mjs'
1111
import { runCommandQuiet } from './utils/run-command.mjs'
@@ -32,7 +32,7 @@ const vitestArgs = [
3232
'vitest',
3333
'run',
3434
'--coverage',
35-
...process.argv.slice(2).filter((arg) => !customFlags.includes(arg)),
35+
...process.argv.slice(2).filter(arg => !customFlags.includes(arg)),
3636
]
3737
const typeCoverageArgs = ['exec', 'type-coverage']
3838

src/spinner.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import type { Writable } from 'node:stream'
77

88
// Note: getAbortSignal is imported lazily to avoid circular dependencies.
99
import { CI } from '#env/ci'
10-
import yoctoSpinner from './external/@socketregistry/yocto-spinner'
11-
1210
import { generateSocketSpinnerFrames } from './effects/pulse-frames'
1311
import type {
1412
ShimmerColorGradient,
@@ -17,6 +15,7 @@ import type {
1715
ShimmerState,
1816
} from './effects/text-shimmer'
1917
import { applyShimmer, COLOR_INHERIT, DIR_LTR } from './effects/text-shimmer'
18+
import yoctoSpinner from './external/@socketregistry/yocto-spinner'
2019
import { hasOwn } from './objects'
2120
import { isBlankString, stringWidth } from './strings'
2221

src/strings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* Provides string processing, prefix application, and terminal output utilities.
44
*/
55

6-
import { eastAsianWidth } from './external/get-east-asian-width'
76
import { ansiRegex, stripAnsi } from './ansi'
7+
import { eastAsianWidth } from './external/get-east-asian-width'
88
// Import get-east-asian-width from external wrapper.
99
// This library implements Unicode Standard Annex #11 (East Asian Width).
1010
// https://www.unicode.org/reports/tr11/

test/registry/arrays.test.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ describe('arrays', () => {
1616
it('should split array into chunks of specified size', () => {
1717
const arr = [1, 2, 3, 4, 5, 6]
1818
const result = arrayChunk(arr, 2)
19-
expect(result).toEqual([[1, 2], [3, 4], [5, 6]])
19+
expect(result).toEqual([
20+
[1, 2],
21+
[3, 4],
22+
[5, 6],
23+
])
2024
})
2125

2226
it('should handle uneven chunks', () => {
@@ -28,7 +32,10 @@ describe('arrays', () => {
2832
it('should default to chunk size of 2', () => {
2933
const arr = [1, 2, 3, 4]
3034
const result = arrayChunk(arr)
31-
expect(result).toEqual([[1, 2], [3, 4]])
35+
expect(result).toEqual([
36+
[1, 2],
37+
[3, 4],
38+
])
3239
})
3340

3441
it('should handle single element arrays', () => {
@@ -45,8 +52,12 @@ describe('arrays', () => {
4552

4653
it('should throw error for chunk size <= 0', () => {
4754
const arr = [1, 2, 3]
48-
expect(() => arrayChunk(arr, 0)).toThrow('Chunk size must be greater than 0')
49-
expect(() => arrayChunk(arr, -1)).toThrow('Chunk size must be greater than 0')
55+
expect(() => arrayChunk(arr, 0)).toThrow(
56+
'Chunk size must be greater than 0',
57+
)
58+
expect(() => arrayChunk(arr, -1)).toThrow(
59+
'Chunk size must be greater than 0',
60+
)
5061
})
5162

5263
it('should handle chunk size larger than array', () => {
@@ -58,7 +69,10 @@ describe('arrays', () => {
5869
it('should work with readonly arrays', () => {
5970
const arr: readonly number[] = [1, 2, 3, 4]
6071
const result = arrayChunk(arr, 2)
61-
expect(result).toEqual([[1, 2], [3, 4]])
72+
expect(result).toEqual([
73+
[1, 2],
74+
[3, 4],
75+
])
6276
})
6377
})
6478

test/registry/promises.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ describe('promises', () => {
152152

153153
await pRetry(fn, { retries: 2, baseDelayMs: 10, onRetry })
154154
expect(onRetry).toHaveBeenCalledTimes(1)
155-
expect(onRetry).toHaveBeenCalledWith(1, expect.any(Error), expect.any(Number))
155+
expect(onRetry).toHaveBeenCalledWith(
156+
1,
157+
expect.any(Error),
158+
expect.any(Number),
159+
)
156160
})
157161

158162
it('should cancel retry if onRetry returns false', async () => {

test/registry/strings.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import {
1313
isNonEmptyString,
1414
repeatString,
1515
search,
16+
stringWidth,
1617
stripAnsi,
1718
stripBom,
18-
stringWidth,
1919
toKebabCase,
2020
trimNewlines,
2121
} from '../../../src/lib/strings'

0 commit comments

Comments
 (0)