Skip to content

Commit

Permalink
chore: Fix biome linting stuff (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt authored Jul 7, 2024
1 parent 0df5b24 commit 89606d2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"javascript": {
"formatter": {
"trailingComma": "none",
"trailingCommas": "none",
"arrowParentheses": "asNeeded",
"quoteStyle": "single"
}
Expand Down
12 changes: 12 additions & 0 deletions sites/avivator/src/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import {
isInterleaved
} from './utils';

/** @typedef {{ urlOrFile: string | File; description: string; isDemoImage: boolean; }} ImageSource */

/** @param {ImageSource} source */
export const useImage = source => {
const [use3d, toggleUse3d, toggleIsOffsetsSnackbarOn] = useViewerStore(
store => [store.use3d, store.toggleUse3d, store.toggleIsOffsetsSnackbarOn],
Expand Down Expand Up @@ -81,6 +84,15 @@ export const useImage = source => {
}
}
if (source) changeLoader();

// FIXME: biome warns that source shouldn't be a dep because it changes every render,
// but it's necessary to trigger the effect (and make avivator functional).
//
// The overall implementation of this "hook" is very strange. It is all async side effects
// that eventually update global state and is very tricky to reason about. There is probably
// a more ideomatic way to do this with zustand.
//
// biome-ignore lint/correctness/useExhaustiveDependencies: see above
}, [source, history]);

// biome-ignore lint/correctness/useExhaustiveDependencies: Carried over from eslint, without explanation.
Expand Down

0 comments on commit 89606d2

Please sign in to comment.