From 5519b844099b850ca0804592ac3306ebe1a9b349 Mon Sep 17 00:00:00 2001 From: Prakash Date: Thu, 21 May 2026 09:58:03 +0530 Subject: [PATCH] @uppy: upgrade biome and more improvements (#6244) - This PR upgrades `biome` from `2.0.5` -> `2.1.2` and adds two new rules - [noUnusedImports](https://biomejs.dev/linter/rules/no-unused-private-class-members) ( we already had suppressions for this rule in code, but the rule itself was never enabled in the config ) - [noUnusedPrivateClassMembers](https://biomejs.dev/linter/rules/no-unused-private-class-members/) - remove stale suppressions. - remove stale code. --------- Co-authored-by: Mikael Finstad --- biome.json | 80 +++++---- examples/aws-companion/index.html | 2 +- examples/aws-nodejs/public/index.html | 7 +- .../public/withCustomEndpoints.html | 7 +- examples/aws-php/index.html | 2 +- examples/cdn/index.html | 6 +- examples/companion-custom-provider/index.html | 2 +- .../companion-digitalocean-spaces/index.html | 2 +- examples/companion/client/index.html | 4 +- examples/react/src/App.tsx | 2 +- .../src/components/CustomDropzone.svelte | 8 +- .../src/components/ImageEditor.svelte | 23 +-- .../src/components/MediaCapture.svelte | 11 +- .../src/components/RemoteSource.svelte | 1 + .../components/test/props-reactivity.svelte | 4 +- examples/transloadit/index.html | 4 +- examples/transloadit/server.js | 8 +- examples/vue/src/Dropzone.vue | 8 +- examples/vue/src/ImageEditor.vue | 23 +-- examples/vue/src/MediaCapture.vue | 10 +- examples/xhr-bundle/index.html | 2 +- examples/xhr-node/index.html | 2 +- examples/xhr-php/index.html | 2 +- examples/xhr-python/index.html | 2 +- package.json | 2 +- packages/@uppy/audio/src/Audio.tsx | 4 +- .../aws-s3/src/HTTPCommunicationQueue.ts | 6 +- .../@uppy/aws-s3/src/MultipartUploader.ts | 1 + .../src/scripts/with-load-balancer.ts | 4 +- .../@uppy/companion/src/server/Uploader.ts | 6 +- .../src/server/provider/facebook/adapter.ts | 2 +- .../@uppy/companion/src/types/express.d.ts | 4 +- packages/@uppy/companion/src/types/shims.d.ts | 2 +- .../@uppy/companion/test/credentials.test.ts | 2 +- .../@uppy/companion/test/providers.test.ts | 29 ++-- packages/@uppy/companion/test/url.test.ts | 31 ++-- packages/@uppy/compressor/src/index.ts | 1 - packages/@uppy/core/src/Restricter.ts | 4 +- packages/@uppy/core/src/Uppy.test.ts | 163 +++++++++--------- packages/@uppy/core/src/Uppy.ts | 7 +- packages/@uppy/core/src/loggers.ts | 2 +- packages/@uppy/dashboard/src/Dashboard.tsx | 14 +- .../dashboard/src/components/AddFiles.tsx | 22 +-- .../src/components/AddFilesPanel.tsx | 1 - .../dashboard/src/components/EditorPanel.tsx | 1 - .../src/components/FileCard/index.tsx | 1 - .../dashboard/src/components/FileList.tsx | 1 - .../src/components/PickerPanelContent.tsx | 1 - .../src/components/StatusBar/Components.tsx | 16 +- packages/@uppy/dashboard/src/index.test.ts | 3 - .../dashboard/src/utils/createSuperFocus.ts | 1 - .../@uppy/dashboard/src/utils/trapFocus.ts | 1 - packages/@uppy/form/src/index.ts | 2 +- packages/@uppy/golden-retriever/src/index.ts | 1 - packages/@uppy/locales/src/ar_SA.ts | 4 +- packages/@uppy/locales/src/bg_BG.ts | 4 +- packages/@uppy/locales/src/ca_ES.ts | 4 +- packages/@uppy/locales/src/cs_CZ.ts | 4 +- packages/@uppy/locales/src/da_DK.ts | 4 +- packages/@uppy/locales/src/de_DE.ts | 4 +- packages/@uppy/locales/src/el_GR.ts | 4 +- packages/@uppy/locales/src/en_US.ts | 4 +- packages/@uppy/locales/src/es_ES.ts | 4 +- packages/@uppy/locales/src/es_MX.ts | 4 +- packages/@uppy/locales/src/fa_IR.ts | 4 +- packages/@uppy/locales/src/fi_FI.ts | 4 +- packages/@uppy/locales/src/fr_FR.ts | 4 +- packages/@uppy/locales/src/gl_ES.ts | 4 +- packages/@uppy/locales/src/he_IL.ts | 4 +- packages/@uppy/locales/src/hi_IN.ts | 4 +- packages/@uppy/locales/src/hr_HR.ts | 4 +- packages/@uppy/locales/src/hu_HU.ts | 4 +- packages/@uppy/locales/src/id_ID.ts | 4 +- packages/@uppy/locales/src/is_IS.ts | 4 +- packages/@uppy/locales/src/it_IT.ts | 4 +- packages/@uppy/locales/src/ja_JP.ts | 4 +- packages/@uppy/locales/src/ko_KR.ts | 4 +- packages/@uppy/locales/src/ms_MY.ts | 4 +- packages/@uppy/locales/src/nb_NO.ts | 4 +- packages/@uppy/locales/src/nl_NL.ts | 4 +- packages/@uppy/locales/src/pl_PL.ts | 4 +- packages/@uppy/locales/src/pt_BR.ts | 4 +- packages/@uppy/locales/src/pt_PT.ts | 4 +- packages/@uppy/locales/src/ro_RO.ts | 4 +- packages/@uppy/locales/src/ru_RU.ts | 4 +- packages/@uppy/locales/src/sk_SK.ts | 4 +- packages/@uppy/locales/src/sr_RS_Cyrillic.ts | 4 +- packages/@uppy/locales/src/sr_RS_Latin.ts | 4 +- packages/@uppy/locales/src/sv_SE.ts | 4 +- packages/@uppy/locales/src/th_TH.ts | 4 +- packages/@uppy/locales/src/tr_TR.ts | 4 +- packages/@uppy/locales/src/uk_UA.ts | 4 +- packages/@uppy/locales/src/uz_UZ.ts | 4 +- packages/@uppy/locales/src/vi_VN.ts | 4 +- packages/@uppy/locales/src/zh_CN.ts | 4 +- packages/@uppy/locales/src/zh_TW.ts | 4 +- packages/@uppy/locales/template.ts | 4 +- packages/@uppy/status-bar/src/Components.tsx | 16 +- .../@uppy/thumbnail-generator/src/index.ts | 2 +- packages/@uppy/transloadit/src/Assembly.ts | 5 +- .../@uppy/transloadit/src/AssemblyWatcher.ts | 1 + packages/@uppy/transloadit/src/index.ts | 11 +- packages/@uppy/tus/src/index.ts | 2 - packages/@uppy/utils/src/Translator.ts | 5 +- packages/@uppy/webcam/src/Webcam.test.ts | 14 +- packages/@uppy/webcam/src/Webcam.tsx | 6 +- .../webcam/src/supportsMediaRecorder.test.ts | 8 +- packages/@uppy/xhr-upload/src/index.ts | 4 +- private/dev/dragdrop.html | 2 +- private/dev/index.html | 2 +- yarn.lock | 74 ++++---- 111 files changed, 432 insertions(+), 449 deletions(-) diff --git a/biome.json b/biome.json index c8f42a2ec..13f580c8c 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.0.5/schema.json", + "$schema": "https://biomejs.dev/schemas/2.4.15/schema.json", "vcs": { "enabled": true, "clientKind": "git", @@ -14,10 +14,11 @@ "bin/**", "e2e/**", "private/**", - "!packages/**/{dist,lib}/**", + "!packages/**/{dist,lib}", "!node_modules", "!.svelte-kit", - "!packages/@uppy/components/src/input.css" + "!packages/@uppy/components/src/input.css", + "!examples/angular/**/*.html" ] }, "formatter": { @@ -25,20 +26,11 @@ "indentStyle": "space", "formatWithErrors": true }, + "html": { + "experimentalFullSupportEnabled": true + }, "linter": { "enabled": true, - "includes": [ - "packages/**", - "examples/**", - "scripts/**", - "private/**", - "!packages/**/{dist,lib}/**", - "!node_modules", - "!.svelte-kit", - "!packages/@uppy/components/src/input.css", - "!**/*.vue", - "!**/*.svelte" - ], "rules": { "recommended": true, "suspicious": { @@ -48,37 +40,26 @@ "useExhaustiveDependencies": "error", "useHookAtTopLevel": "error", "noUnusedFunctionParameters": "off", + "noUnusedImports": "error", + "noUnusedPrivateClassMembers": "error", "noUnusedVariables": { "level": "error", "options": { "ignoreRestSiblings": true } - } + }, + "noNestedComponentDefinitions": "error", + "noReactPropAssignments": "error" }, "style": { "noNonNullAssertion": "off" }, "a11y": { - "noSvgWithoutTitle": "off" - }, - "nursery": { - "noNestedComponentDefinitions": "error", - "noReactPropAssign": "error" + "noSvgWithoutTitle": "off", + "useSemanticElements": "off" } } }, - "overrides": [ - { - "includes": ["packages/@uppy/companion/**"], - "linter": { - "rules": { - "complexity": { - "useLiteralKeys": "off" - } - } - } - } - ], "javascript": { "formatter": { "quoteStyle": "single", @@ -92,5 +73,36 @@ "organizeImports": "on" } } - } + }, + "overrides": [ + { + "includes": ["packages/@uppy/companion/**"], + "linter": { + "rules": { + "complexity": { + "useLiteralKeys": "off" + } + } + } + }, + { + "includes": ["**/*.vue", "**/*.svelte", "packages/@uppy/vue/**/*.ts"], + "linter": { + "rules": { + "correctness": { + "useHookAtTopLevel": "off", + "useExhaustiveDependencies": "off" + } + } + } + }, + { + "includes": ["examples/nextjs/**/*.css"], + "css": { + "parser": { + "tailwindDirectives": true + } + } + } + ] } diff --git a/examples/aws-companion/index.html b/examples/aws-companion/index.html index 0b86787b7..01eacb7a8 100644 --- a/examples/aws-companion/index.html +++ b/examples/aws-companion/index.html @@ -1,5 +1,5 @@ - + diff --git a/examples/aws-nodejs/public/index.html b/examples/aws-nodejs/public/index.html index 881a07567..cd7d79f60 100644 --- a/examples/aws-nodejs/public/index.html +++ b/examples/aws-nodejs/public/index.html @@ -1,5 +1,5 @@ - + Uppy – AWS upload example @@ -24,7 +24,8 @@
- + - +
diff --git a/examples/transloadit/index.html b/examples/transloadit/index.html index a3919ae1f..a9e0b9c1f 100644 --- a/examples/transloadit/index.html +++ b/examples/transloadit/index.html @@ -1,5 +1,5 @@ - + @@ -140,7 +140,7 @@ This API is a one-shot upload UI using a modal overlay. Call the function and receive a listen to an event with upload results ✌️

- +

uppy.upload()

An <input type=file> backed by uppy.upload():

diff --git a/examples/transloadit/server.js b/examples/transloadit/server.js index 765301bd5..c71994b0e 100755 --- a/examples/transloadit/server.js +++ b/examples/transloadit/server.js @@ -36,7 +36,7 @@ function Footer() { } function FormFields(fields) { - // biome-ignore lint/nursery/noNestedComponentDefinitions: not a react component + // biome-ignore lint/correctness/noNestedComponentDefinitions: not a react component function Field([name, value]) { if (name === 'transloadit') return '' let isValueJSON = false @@ -76,7 +76,7 @@ function FormFields(fields) { } function UploadsList(uploads) { - // biome-ignore lint/nursery/noNestedComponentDefinitions: not a react component + // biome-ignore lint/correctness/noNestedComponentDefinitions: not a react component function Upload(upload) { return `
  • ${e(upload.name)}
  • ` } @@ -89,12 +89,12 @@ function UploadsList(uploads) { } function ResultsList(results) { - // biome-ignore lint/nursery/noNestedComponentDefinitions: not a react component + // biome-ignore lint/correctness/noNestedComponentDefinitions: not a react component function Result(result) { return `
  • ${e(result.name)} View
  • ` } - // biome-ignore lint/nursery/noNestedComponentDefinitions: not a react component + // biome-ignore lint/correctness/noNestedComponentDefinitions: not a react component function ResultsSection(stepName) { return `

    ${e(stepName)}

    diff --git a/examples/vue/src/Dropzone.vue b/examples/vue/src/Dropzone.vue index c36d0a9a9..4bb75fd80 100644 --- a/examples/vue/src/Dropzone.vue +++ b/examples/vue/src/Dropzone.vue @@ -7,7 +7,7 @@ >
    - - - -
    +
    - - - - -
    - - - -
    - - - - - -