@uppy: upgrade biome and more improvements#6244
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dde27afd84
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
looks good but I think we should wait until typescript pr #6179 is merged |
|
once the conflicts are resolved i think this can be merged |
There was a problem hiding this comment.
- upgraded biome
2.1.2 → 2.4.15 - added
html.experimentalFullSupportEnabled: true - Moved noNestedComponentDefinitions + noReactPropAssign (renamed → noReactPropAssignments) from nursery to correctness (where they now live in 2.4)
- added fixes triggered by Vue/Svelte/HTML now being properly linted
- Cleanup forced by Biome 2.4 + TypeScript stricter checks
Leveraged AI heavily in making these changes.
|
lgtm but verify that the changess in biome.json and correct, and verify that code inside packages is still being linted after this change ( |
| "linter": { | ||
| "enabled": true, | ||
| "includes": [ | ||
| "packages/**", | ||
| "examples/**", | ||
| "scripts/**", | ||
| "private/**", | ||
| "!packages/**/{dist,lib}/**", | ||
| "!node_modules", | ||
| "!.svelte-kit", | ||
| "!packages/@uppy/components/src/input.css", | ||
| "!**/*.vue", | ||
| "!**/*.svelte" | ||
| ], |
There was a problem hiding this comment.
we can safely remove this now because biome 2.4 can fully lint .vue and .svelte files using the flag experimentalFullSupportEnabled: true , linter.includes falls back to files.includes , which already contains all the paths which should be linted.
There was a problem hiding this comment.
previously we needed this block so that we can disable lint for .vue and svelte files. check the last two paths
"!**/*.vue",
"!**/*.svelte"
| "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/angular/**"], | ||
| "linter": { | ||
| "enabled": false | ||
| } | ||
| }, | ||
| { | ||
| "includes": ["examples/nextjs/**/*.css"], | ||
| "css": { | ||
| "parser": { | ||
| "tailwindDirectives": true | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
this override block is used for overriding lint rules for certain paths , I will check them to see what do we actually need , for example : the first rule https://biomejs.dev/linter/rules/use-literal-keys/
disables the enforcement of literal access of objects i.e. obj.someKey instead of compuated access i.e. obj["someKey"] because companion uses it a lot , so rules like these must have been added by AI to reduce the linter noise.
{
"includes": ["packages/@uppy/companion/**"],
"linter": {
"rules": {
"complexity": {
"useLiteralKeys": "off"
}
}
verified ! , linting works in a random uppy plugin and random example. biome changes look correct still I will add small summaries of the reasoning given by AI and then we can decide on what to and what to revert. |
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
| "includes": ["packages/@uppy/companion/**"], | ||
| "linter": { | ||
| "rules": { | ||
| "complexity": { | ||
| "useLiteralKeys": "off" | ||
| } | ||
| } | ||
| } | ||
| }, |
There was a problem hiding this comment.
this is added due to a conflict : companion's tsconfig.shared.json sets noPropertyAccessFromIndexSignature: true. This is a deliberate, strict TypeScript option that says:
"If a property comes from an index signature (like process.env, req.query, req.body), you MUST use
bracket notation to access it."
| "includes": ["**/*.vue", "**/*.svelte", "packages/@uppy/vue/**/*.ts"], | ||
| "linter": { | ||
| "rules": { | ||
| "correctness": { | ||
| "useHookAtTopLevel": "off", | ||
| "useExhaustiveDependencies": "off" | ||
| } | ||
| } | ||
| } | ||
| }, |
There was a problem hiding this comment.
AI Summary :
What policy this protects: the framework's own reactivity model
These two rules are React-specific:
- useHookAtTopLevel - React's "Rules of Hooks" (no conditionals, no loops, top-level only)
- useExhaustiveDependencies — React's useEffect / useMemo / useCallback dependency-array discipline
Biome triggers them on any identifier starting with use*. But:
- Vue composables (useUppy, useDropzone, useFileInput) have no rules-of-hooks constraint — they're
plain functions returning reactive refs. They can be called conditionally, in loops, anywhere. - Svelte 5 runes ($state, $derived, $effect) have automatic dependency tracking — there is no manual
dependency array to keep exhaustive.
| "includes": ["examples/angular/**"], | ||
| "linter": { | ||
| "enabled": false | ||
| } |
There was a problem hiding this comment.
I tested without this override , it worked fine so I think we can remove this.
| "includes": ["examples/nextjs/**/*.css"], | ||
| "css": { | ||
| "parser": { | ||
| "tailwindDirectives": true | ||
| } | ||
| } |
There was a problem hiding this comment.
AI summary :
The Next.js example uses Tailwind v4 directives:
@tailwind base;
@tailwind components;
@tailwind utilities;
@apply text-lg font-bold;
These are not standard CSS. Without the tailwindDirectives: true setting, Biome's CSS parser errors
on @tailwind and @apply as unknown at-rules. Then the file fails to parse → nothing can be linted or
formatted.
|
let's merge this after #6300 is merged - there might be some conflicts in yarn.lock |
exact copy of #6175 - I will point the uppy deps upgrade pr to this PR's branch - no other changes needed in this branch as #6175 was reviewed and all the comments were resolved this should be the order of merge : 1. #6300 2. uppy deps upgrade ( yet to be raised ) 3. merge this to main 4. merge biome changes #6244 @mifi let me know if you think otherwise. --------- Co-authored-by: Mikael Finstad <finstaden@gmail.com>
biomefrom2.0.5->2.1.2and adds two new rules