Skip to content

Commit f2df13d

Browse files
committed
chore: lint and format
1 parent 587f966 commit f2df13d

File tree

15 files changed

+23
-25
lines changed

15 files changed

+23
-25
lines changed

docs/app/assets/css/main.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
.hero-gradient {
2-
background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.15), transparent),
2+
background:
3+
radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.15), transparent),
34
radial-gradient(ellipse 60% 40% at 80% 100%, rgba(16, 185, 129, 0.1), transparent);
45
}
56

67
.dark .hero-gradient {
7-
background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.2), transparent),
8+
background:
9+
radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.2), transparent),
810
radial-gradient(ellipse 60% 40% at 80% 100%, rgba(16, 185, 129, 0.15), transparent);
911
}

src/runtime/composables/useUploadKit/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ export const useUploadKit = <TUploadResult = any>(_options: UploadOptions = {})
232232
* onProgress(50); // 50% progress
233233
* return "https://example.com/uploaded-file-url"; // Return the upload URL
234234
* }
235-
* @returns void
236235
*/
237236
const onUpload = (fn: UploadFn<TUploadResult>) => {
238237
uploadFn = fn

src/runtime/composables/useUploadKit/plugins/image-compressor.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { UploadFile } from "../types"
22
import { defineProcessingPlugin } from "../types"
3-
import { calculateThumbnailDimensions } from "../utils"
43

54
/**
65
* Events emitted by the image compressor plugin

src/runtime/composables/useUploadKit/plugins/thumbnail-generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const PluginThumbnailGenerator = defineProcessingPlugin<ThumbnailGenerato
1212
return {
1313
id: "thumbnail-generator",
1414
hooks: {
15-
preprocess: async (file, context) => {
15+
preprocess: async (file, _context) => {
1616
const { maxWidth = 200, maxHeight = 200, quality = 0.7, videoCaptureTime = 1 } = pluginOptions
1717

1818
// Skip non-image and non-video files

src/runtime/composables/useUploadKit/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ export type PluginHooks<TUploadResult = any, TPluginEvents extends Record<string
402402
*
403403
* These plugins transform or validate files without handling storage.
404404
*/
405-
export interface ProcessingPlugin<TUploadResult = any, TPluginEvents extends Record<string, any> = Record<string, never>> {
405+
export interface ProcessingPlugin<_TUploadResult = any, TPluginEvents extends Record<string, any> = Record<string, never>> {
406406
id: string
407407
hooks: ProcessingPluginHooks<TPluginEvents>
408408
options?: UploadOptions

test/helpers/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export function mockCreateObjectURL(): { mock: ReturnType<typeof vi.fn>; cleanup
9292
const originalCreateObjectURL = URL.createObjectURL
9393
const originalRevokeObjectURL = URL.revokeObjectURL
9494

95-
const createMock = vi.fn((blob: Blob) => `blob:mock-${Math.random().toString(36).slice(2)}`)
95+
const createMock = vi.fn((_blob: Blob) => `blob:mock-${Math.random().toString(36).slice(2)}`)
9696
const revokeMock = vi.fn()
9797

9898
URL.createObjectURL = createMock
@@ -145,7 +145,7 @@ export function mockCanvasContext() {
145145
const mockCanvas = {
146146
getContext: vi.fn(() => mockContext),
147147
toDataURL: vi.fn(() => "data:image/jpeg;base64,mockdata"),
148-
toBlob: vi.fn((callback: BlobCallback, type?: string, quality?: number) => {
148+
toBlob: vi.fn((callback: BlobCallback, type?: string, _quality?: number) => {
149149
const blob = new Blob(["mock"], { type: type || "image/jpeg" })
150150
callback(blob)
151151
}),
@@ -167,7 +167,7 @@ export function mockCanvasContext() {
167167
/**
168168
* Create multiple mock files with different properties
169169
*/
170-
export function createMockFiles(count: number, baseOptions: Partial<File> = {}): File[] {
170+
export function createMockFiles(count: number, _baseOptions: Partial<File> = {}): File[] {
171171
return Array.from({ length: count }, (_, i) =>
172172
createMockFile(`test-file-${i + 1}.jpg`, 1024 * (i + 1), "image/jpeg", Date.now() - i * 1000),
173173
)

test/unit/events.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, it, expect, vi, beforeEach } from "vitest"
2-
import { createMockFile, wait } from "../helpers"
2+
import { createMockFile } from "../helpers"
33

44
// Mock Vue's onBeforeUnmount
55
vi.mock("vue", async () => {

test/unit/plugins/azure-datalake.test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"
2-
import { createMockLocalUploadFile, createMockPluginContext, createMockBlob } from "../../helpers"
1+
import { describe, it, expect, vi, beforeEach } from "vitest"
2+
import { createMockPluginContext } from "../../helpers"
3+
import { PluginAzureDataLake } from "../../../src/runtime/composables/useUploadKit/plugins/storage/azure-datalake"
34

4-
// Mock the Azure SDK before importing the plugin
5+
// Mock the Azure SDK - vitest hoists vi.mock calls automatically
56
vi.mock("@azure/storage-file-datalake", () => ({
67
DataLakeDirectoryClient: vi.fn().mockImplementation((sasUrl: string) => {
78
const mockFileClient = {
@@ -29,9 +30,6 @@ vi.mock("@azure/storage-file-datalake", () => ({
2930
}),
3031
}))
3132

32-
// Import after mocking
33-
import { PluginAzureDataLake } from "../../../src/runtime/composables/useUploadKit/plugins/storage/azure-datalake"
34-
3533
describe("PluginAzureDataLake", () => {
3634
beforeEach(() => {
3735
vi.clearAllMocks()

test/unit/plugins/image-compressor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"
22
import { PluginImageCompressor } from "../../../src/runtime/composables/useUploadKit/plugins/image-compressor"
3-
import { createMockLocalUploadFile, createMockRemoteUploadFile, createMockPluginContext, createMockBlob } from "../../helpers"
3+
import { createMockLocalUploadFile, createMockRemoteUploadFile, createMockPluginContext } from "../../helpers"
44

55
describe("PluginImageCompressor", () => {
66
let originalCreateObjectURL: typeof URL.createObjectURL

test/unit/plugins/thumbnail-generator.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ describe("PluginThumbnailGenerator", () => {
254254
const maxHeight = 200
255255

256256
const aspectRatio = originalWidth / originalHeight // 8
257-
let scaledWidth = maxWidth
257+
const scaledWidth = maxWidth
258258
let scaledHeight = maxHeight
259259

260260
if (aspectRatio > 1) {

0 commit comments

Comments
 (0)