Conversation
Safe, no-behavior-change fixes across the monorepo: - Remove 75+ unused imports, variables, and type declarations - Fix no-undef errors by adding eslint-env node to Node.js scripts - Fix react/no-unescaped-entities by escaping apostrophes in JSX - Remove unused catch parameters - Add missing displayName to forwardRef components - Fix missing key props in iterators - Replace empty interfaces with type aliases Packages affected: - @wcpos/core: 82 → 36 problems - @wcpos/components: 43 → 25 problems - @wcpos/web-bundle: 2 → 2 problems (all fixed, remaining are no-undef) - @wcpos/main: 4 → 2 problems - @wcpos/utils: 4 → 3 problems Total reduction: 213 → 138 problems (~35% reduction)
Fixes for hooks dependency issues: - Add eslint-disable comments for intentional patterns (cache busters, identity keys) - Remove unnecessary dependencies where safe - Add txInstance to translations context dependencies - Fix stable ref patterns in collapsible primitives - Remove unused type declarations and imports from query hooks Query hooks cleaned: - categories.tsx, customers.tsx, orders.tsx, products.ts - tags.tsx, tax-rates.tsx, variations.ts Packages affected: - @wcpos/query: 33 → 15 problems - @wcpos/components: Added eslint-disable for intentional patterns Total reduction: 138 → 116 problems
Fixed mutation-during-render issues in UI settings forms: - Moved ref mutations to useEffect (customers, orders, logs, reports, pos-cart, pos-products, products) - Added eslint-disable comments for intentional ref mutations from useObservableRef Fixed mutation issues in: - pos/cart/cells/actions.tsx - moved newRowUUIDs update to useEffect - use-date-format.tsx - suppress warning for intentional visibleRef mutation - pos/products/index.tsx - suppress for expandedRef mutations in table config - products/products.tsx - same expandedRef pattern Note: Some react-compiler "skipped optimizing" warnings remain as an acceptable trade-off for maintaining the ref mutation patterns required by the architecture.
Removed unused files: - packages/components/src/icon/styles.ts (legacy styled-components code) - packages/query/src/devtools/ folder (commented out, uses non-existent components) - apps/main/hooks/use-sticky-immersive-reset.ts (unused, packages not installed) Cleanup: - Removed commented export from packages/query/src/index.ts This resolves 8 import/no-unresolved errors.
Updates apps/electron submodule to include: - Remove unused catch parameter 'e' in database.ts - Remove unused ROOT, SCHEME imports in util.ts - Use LatestRelease interface to type data in update.ts - Add eslint-disable comments for intentional require() calls All 11 Electron package warnings resolved.
Instead of removing submodules from the workspace (which breaks builds), use turbo filters to exclude them from lint and test tasks: - Keep apps/electron and apps/web in pnpm-workspace.yaml - Add --filter='!@wcpos/app-electron' --filter='!@wcpos/web-bundle' to lint/test scripts - Keep eslint ignores for the submodule directories This allows: - pnpm dev:electron and build commands to still work - lint/test at root to skip submodules (they manage their own)
📝 WalkthroughWalkthroughThis PR performs extensive code cleanup and refactoring across the monorepo, including: adding a GitHub Actions workflow for automated translation updates, removing unused imports and type declarations, relocating mutable ref assignments from render time to useEffect hooks, eliminating devtools components, and adding ESLint pragmas to suppress linting warnings for intentional patterns. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Triggers extract-js workflow in wcpos/translations when TS/TSX files change on main, using GitHub App token for cross-repo access. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
packages/components/src/format-number/format-number.tsx (2)
132-139:⚠️ Potential issue | 🔴 CriticalBug:
indexis undefined ingetMaskAtIndex.The function references
indexon line 138, but no such parameter is defined. The function is called with an argument (getMaskAtIndex(hashCount)on line 150), but the definition doesn't accept any parameters.🐛 Proposed fix
- const getMaskAtIndex = React.useCallback(() => { + const getMaskAtIndex = React.useCallback((index: number) => { const { mask = ' ' } = props; if (typeof mask === 'string') { return mask; } return mask[index] || ' '; - }, [props]); + }, [props.mask]);Note: The dependency array should also be narrowed to
props.masksince that's the only property accessed.
172-173:⚠️ Potential issue | 🟡 MinorType mismatch:
formatfunction expectsnumberbut receivesstring.The
formatprop is typed as(value: number) => string(line 28), butformattedValueis astring. This type inconsistency could lead to unexpected behavior.Consider updating the type definition to match actual usage:
- format?: string | ((value: number) => string); + format?: string | ((value: string) => string);Or ensure the value is converted to a number before calling the format function.
packages/core/src/screens/main/components/header/user-menu.tsx (1)
58-58:⚠️ Potential issue | 🟡 MinorProperty name case mismatch:
localIdvslocalIDprevents disabled state from being applied.Line 58 uses
store.localId(lowercase 'd'), but the StoreDocument schema defines the property aslocalID(uppercase 'D'). This causes the comparison to always evaluate tofalse(comparingundefinedto a string), so the disabled state will never apply even for the current store.Proposed fix
<DropdownMenuItem key={store.localID} onPress={() => switchStore(store)} - disabled={store.localId === currentStoreID} + disabled={store.localID === currentStoreID} >packages/core/src/screens/main/pos/cart/table.tsx (1)
208-210:⚠️ Potential issue | 🟡 MinorReplace
console.logand avoidanyin table metaonChange.
Use the logger and a safer type to align with project rules.🔧 Suggested fix
import { Text } from '@wcpos/components/text'; +import log from '@wcpos/utils/logger'; @@ - onChange: (data: any) => { - console.log('onChange called without handler', data); - }, + onChange: (data: unknown) => { + log.warn('onChange called without handler', data); + },
🤖 Fix all issues with AI agents
In @.github/workflows/update-translations.yml:
- Around line 1-33: The workflow uses an outdated
actions/create-github-app-token@v1 and lacks fail-fast handling for the shell
command; update the step that uses actions/create-github-app-token to a current
version (use `@v2` or pin to `@v2.2.1`) in the "Generate GitHub App token" step, and
make the "Trigger translations repo extraction" step's shell run safer by
enabling fail-fast (e.g., use set -e or equivalent) so the gh workflow run
command fails the job on errors; reference these changes in the steps named
"Generate GitHub App token" and "Trigger translations repo extraction" within
the trigger job.
In `@apps/main/app/`+not-found.tsx:
- Line 14: Replace the HTML entity ' inside the JSX text with a real
apostrophe so it renders correctly; locate the <Text> element in +not-found.tsx
(the JSX node containing "This screen doesn't exist.") and change the
string to use either a plain apostrophe ("This screen doesn't exist.") or the
Unicode escape form ({'\u0027'}) inside the Text component.
In `@apps/main/components/root-error.tsx`:
- Line 95: The JSX text currently uses the HTML entity ' which will render
literally; update the Text node in root-error.tsx (the <Text
style={styles.subtitle}> element in the RootError component) to use a real
apostrophe or an expression string instead (e.g., {"There's an error"} or
"There's an error") so it displays as "There's an error" instead of
"There's an error".
In `@packages/core/src/screens/main/pos/cart/ui-settings-form.tsx`:
- Around line 40-44: This useEffect is required because we must assign the
resetUI function to the mutable buttonPressHandlerRef after render/mount rather
than during render to avoid mutating refs during rendering and to ensure the
dialog/button handler is synchronized with the mounted component lifecycle;
update the comment to state that useEffect sets buttonPressHandlerRef.current =
resetUI post-mount so the external dialog/button handler sees the latest resetUI
without causing render-time side-effects.
In `@packages/query/src/hooks/categories.tsx`:
- Around line 4-6: Rename the file from categories.tsx to categories.ts (no JSX
present) and remove the empty JSDoc comment at the top; inside the file ensure
the function filterApiQueryParams retains the explicit type signature (params:
Record<string, unknown>) => Record<string, unknown> (or at least keep the
current typed params) and export/usage unchanged, and also update the analogous
function in tags.tsx to include the same Record<string, unknown> type for
consistency (and rename tags.tsx to tags.ts if it likewise contains no JSX).
🧹 Nitpick comments (13)
packages/components/src/virtualized-list/virtualized-list.tsx (1)
83-87: Consider adding type annotation forchildrenparameter.The
Itemcomponent'schildrenparameter lacks a type annotation. While this is pre-existing code, it conflicts with the project's strict typing guideline.♻️ Suggested type annotation
-function Item({ children }) { +function Item({ children }: { children: React.ReactNode }) { // const { item, index } = useItemContext(); return <>{children}</>; }Also, the commented-out code could be removed if it's no longer needed.
packages/components/src/format/list.tsx (1)
12-15: Prefer a stable key over index to avoid reorder bugs.
Ifarraycan reorder or have insertions/removals, usingindexcan cause state mismatches. Since items are strings, preferitem(or\${item}-${index}`` if duplicates are possible).Proposed change
- return <Text key={index}>{item}, </Text>; + return <Text key={item}>{item}, </Text>;packages/core/src/screens/main/components/customer-select.tsx (1)
100-100: Consider replacinganywith a proper type.The
queryparameter usesany, which violates the coding guideline to use strict types. SinceuseQueryis from@wcpos/query, consider typing it properly.♻️ Suggested improvement
-export function CustomerList({ query, withGuest }: { query: any; withGuest: boolean }) { +export function CustomerList({ query, withGuest }: { query: ReturnType<typeof useQuery>; withGuest: boolean }) {Or define a dedicated type/interface for the query object if
ReturnType<typeof useQuery>is too verbose.As per coding guidelines: "Do not use 'any' type; use strict types and generics instead".
packages/query/src/use-relational-query.ts (1)
91-105: Consider clarifying the ESLint disable comment.The comment on line 103 only mentions
parentIdentityKey, but the re-registration logic is also affected bychildIdentityKey(transitively throughregisterQueries). While functionally correct, updating the comment to reference both identity keys would improve clarity.📝 Suggested comment update
- // eslint-disable-next-line react-hooks/exhaustive-deps -- parentIdentityKey triggers re-registration when query identity changes + // eslint-disable-next-line react-hooks/exhaustive-deps -- identity keys trigger re-registration when query identity changes (childIdentityKey via registerQueries)packages/components/src/command/index.tsx (2)
61-72: Avoid usinganytype for the scroll event parameter.The
event: anyviolates the coding guidelines. Consider using the proper React Native type for scroll events.♻️ Suggested fix
+import { Pressable, ScrollView, Text, View, NativeScrollEvent, NativeSyntheticEvent } from 'react-native'; ... const handleScroll = React.useCallback( - (event: any) => { + (event: NativeSyntheticEvent<NativeScrollEvent>) => { const { layoutMeasurement, contentOffset, contentSize } = event.nativeEvent;As per coding guidelines: "Do not use 'any' type; use strict types and generics instead".
107-109: Replace hardcoded color with semantic color class.The hardcoded
backgroundColor: '#e5e7eb'and inline style violate the styling guidelines. Consider using a semantic color class viaclassNamefor theme compatibility.♻️ Suggested fix
const CommandSeparator = React.forwardRef<View, CommandSeparatorProps>((props, ref) => ( - <View ref={ref} style={[{ height: 1, backgroundColor: '#e5e7eb' }]} {...props} /> + <View ref={ref} className="h-px bg-muted" {...props} /> ));As per coding guidelines: "Always prefer semantic color classes (bg-background, bg-card, bg-sidebar, bg-muted, bg-table-header) over hardcoded colors" and "Prefer
classNameover inline styles".packages/components/src/format-number/format-number.tsx (1)
186-188: Add explicit type annotation forvalparameter.The
valparameter has an implicitanytype, which violates the coding guideline to use strict types. As per coding guidelines: "Do not use 'any' type; use strict types and generics instead."♻️ Proposed fix
- const formatInput = React.useCallback((val) => { + const formatInput = React.useCallback((val: string) => { return val; }, []);packages/components/src/data-table/index.tsx (1)
98-99: Replaceconsole.logwith logger.Per coding guidelines, use the logger library exclusively for logging instead of
console.log.Suggested fix
+import log from '@wcpos/utils/logger';onChange: (data: any) => { - console.log('onChange called without handler', data); + log.warn('onChange called without handler', data); },As per coding guidelines: "Use the logger library exclusively for logging; DO NOT use
console.log. Import:import log from '@wcpos/utils/logger'"packages/components/src/data-table/index.web.tsx (1)
87-88: Replaceconsole.logwith logger.Same issue as in
index.tsx- per coding guidelines, use the logger library instead ofconsole.log.Suggested fix
+import log from '@wcpos/utils/logger';onChange: (data: any) => { - console.log('onChange called without handler', data); + log.warn('onChange called without handler', data); },As per coding guidelines: "Use the logger library exclusively for logging; DO NOT use
console.log. Import:import log from '@wcpos/utils/logger'"packages/core/src/utils/merge-stores.ts (1)
41-41: Avoid usinganytype.The
[key: string]: anyindex signature violates the coding guideline to use strict types instead ofany. Consider defining a proper interface for the store object or usingunknownwith type guards.♻️ Suggested improvement
- remoteStores: { id: number; [key: string]: any }[]; + remoteStores: { id: number; [key: string]: unknown }[];Or better, define a dedicated type:
interface RemoteStore { id: number; name?: string; // ... other known properties }As per coding guidelines: "Do not use 'any' type; use strict types and generics instead".
packages/query/src/hooks/categories.tsx (2)
1-8: Consider renaming file extension from.tsxto.ts.This file contains no JSX or React code—only a pure utility function. Using the
.tsxextension is unnecessary and could be misleading. Consider renaming tocategories.tsfor consistency.
1-3: Empty JSDoc comment provides no value.The JSDoc block is empty and doesn't document anything useful. Either add meaningful documentation or remove it.
♻️ Suggested fix
-/** - * - */ const filterApiQueryParams = (params: Record<string, unknown>) => {Or add useful documentation:
-/** - * - */ +/** + * Filters API query parameters before sending to the WooCommerce API. + * `@param` params - The query parameters to filter + * `@returns` The filtered parameters + */ const filterApiQueryParams = (params: Record<string, unknown>) => {packages/core/src/screens/main/components/header/user-menu.tsx (1)
103-103: Consider using a semantic color class for the hover state.
hover:bg-white/10is a hardcoded color that may not adapt well to all themes. As per coding guidelines, prefer semantic color classes to ensure theme compatibility.
| name: Update Translation Strings | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'apps/**/*.ts' | ||
| - 'apps/**/*.tsx' | ||
| - 'packages/**/*.ts' | ||
| - 'packages/**/*.tsx' | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| trigger: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Generate GitHub App token | ||
| id: app-token | ||
| uses: actions/create-github-app-token@v1 | ||
| with: | ||
| app-id: ${{ secrets.TRANSLATION_APP_ID }} | ||
| private-key: ${{ secrets.TRANSLATION_APP_PRIVATE_KEY }} | ||
| owner: wcpos | ||
| repositories: translations | ||
|
|
||
| - name: Trigger translations repo extraction | ||
| run: | | ||
| gh workflow run extract-js.yml \ | ||
| --repo wcpos/translations \ | ||
| --field ref="${{ github.sha }}" | ||
| env: | ||
| GH_TOKEN: ${{ steps.app-token.outputs.token }} |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
actions/create-github-app-token latest version GitHub Action
💡 Result:
The latest release of actions/create-github-app-token is v2.2.1 (released 2025-12-05). [1]
In workflows you can either:
- Track the latest v2.x automatically:
actions/create-github-app-token@v2(current major recommended in the Marketplace docs) [2] - Or pin to the current latest exact release:
actions/create-github-app-token@v2.2.1[1]
Sources: [1] [2]
Update actions/create-github-app-token to a current version.
The workflow uses actions/create-github-app-token@v1, which is outdated. The latest stable version is v2.2.1. Update to @v2 (for automatic major version updates) or pin to @v2.2.1 for consistency.
Additionally, consider adding error handling to the gh workflow run command by including set -e to fail explicitly on errors, improving observability if the target workflow doesn't exist or authentication fails.
♻️ Suggested error handling
- name: Trigger translations repo extraction
run: |
+ set -e
gh workflow run extract-js.yml \
--repo wcpos/translations \
--field ref="${{ github.sha }}"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| name: Update Translation Strings | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'apps/**/*.ts' | |
| - 'apps/**/*.tsx' | |
| - 'packages/**/*.ts' | |
| - 'packages/**/*.tsx' | |
| workflow_dispatch: | |
| jobs: | |
| trigger: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.TRANSLATION_APP_ID }} | |
| private-key: ${{ secrets.TRANSLATION_APP_PRIVATE_KEY }} | |
| owner: wcpos | |
| repositories: translations | |
| - name: Trigger translations repo extraction | |
| run: | | |
| gh workflow run extract-js.yml \ | |
| --repo wcpos/translations \ | |
| --field ref="${{ github.sha }}" | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| name: Update Translation Strings | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'apps/**/*.ts' | |
| - 'apps/**/*.tsx' | |
| - 'packages/**/*.ts' | |
| - 'packages/**/*.tsx' | |
| workflow_dispatch: | |
| jobs: | |
| trigger: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.TRANSLATION_APP_ID }} | |
| private-key: ${{ secrets.TRANSLATION_APP_PRIVATE_KEY }} | |
| owner: wcpos | |
| repositories: translations | |
| - name: Trigger translations repo extraction | |
| run: | | |
| set -e | |
| gh workflow run extract-js.yml \ | |
| --repo wcpos/translations \ | |
| --field ref="${{ github.sha }}" | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} |
🤖 Prompt for AI Agents
In @.github/workflows/update-translations.yml around lines 1 - 33, The workflow
uses an outdated actions/create-github-app-token@v1 and lacks fail-fast handling
for the shell command; update the step that uses actions/create-github-app-token
to a current version (use `@v2` or pin to `@v2.2.1`) in the "Generate GitHub App
token" step, and make the "Trigger translations repo extraction" step's shell
run safer by enabling fail-fast (e.g., use set -e or equivalent) so the gh
workflow run command fails the job on errors; reference these changes in the
steps named "Generate GitHub App token" and "Trigger translations repo
extraction" within the trigger job.
| const filterApiQueryParams = (params: Record<string, unknown>) => { | ||
| return params; | ||
| }; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cat -n packages/query/src/hooks/categories.tsxRepository: wcpos/monorepo
Length of output: 245
🏁 Script executed:
# Find all instances of filterApiQueryParams in the codebase
rg "filterApiQueryParams" --type ts --type tsx -B 2 -A 5Repository: wcpos/monorepo
Length of output: 85
🏁 Script executed:
# Search for filterApiQueryParams function definitions specifically
ast-grep --pattern 'const filterApiQueryParams = ($$$) => {
$$$
}' -A 3Repository: wcpos/monorepo
Length of output: 10826
File extension and empty JSDoc comment should be addressed.
The type annotation improvement with Record<string, unknown> is good and complies with guidelines. The function's no-op behavior (returning params unchanged) is intentional—it mirrors the identical pattern in tags.tsx, as categories and tags don't require query parameter filtering unlike products, orders, and customers.
However, two minor issues should be fixed:
- Change file extension from
.tsxto.tssince there is no JSX or React code - Remove the empty JSDoc comment block (lines 1-3)
Also consider adding the same type annotation to tags.tsx for consistency, as it currently lacks typing.
🤖 Prompt for AI Agents
In `@packages/query/src/hooks/categories.tsx` around lines 4 - 6, Rename the file
from categories.tsx to categories.ts (no JSX present) and remove the empty JSDoc
comment at the top; inside the file ensure the function filterApiQueryParams
retains the explicit type signature (params: Record<string, unknown>) =>
Record<string, unknown> (or at least keep the current typed params) and
export/usage unchanged, and also update the analogous function in tags.tsx to
include the same Record<string, unknown> type for consistency (and rename
tags.tsx to tags.ts if it likewise contains no JSX).
- Wrap non-string items in keyed React.Fragment to avoid key warnings - Clarify useEffect comment explaining animation callback timing Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix getMaskAtIndex missing index parameter in format-number - Fix localId vs localID case mismatch in user-menu - Fix HTML entities rendering literally in JSX (+not-found, root-error) - Replace console.log/any with comment/unknown in cart table - Improve useEffect comments in ui-settings-form - Add type annotation for children in virtualized-list - Rename categories.tsx/tags.tsx to .ts (no JSX) and add typing - Update actions/create-github-app-token to v2 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@packages/query/src/hooks/categories.ts`:
- Around line 1-5: Add a colocated unit test file for the filterApiQueryParams
utility that asserts it returns the exact same object reference passed in
(identity passthrough). Create a file named filterApiQueryParams.test.ts next to
the source, import filterApiQueryParams, call it with a single object instance
and use a strict identity assertion (e.g., expect(result).toBe(input)) and also
include a simple primitive or empty object case to cover edge inputs; ensure the
test runs with the repository test runner configuration.
In `@packages/query/src/hooks/tags.ts`:
- Around line 1-5: Add a colocated unit test file
packages/query/src/hooks/tags.test.ts that imports the filterApiQueryParams
function and asserts its identity passthrough behavior (e.g., passing an object
with various keys and verifying the returned value is deeply equal to the input,
and optionally that it returns the same reference when appropriate). Name the
test suite to reference filterApiQueryParams and include at least one test case
for a typical params object and one for an empty object to cover edge cases.
| const filterApiQueryParams = (params: Record<string, unknown>) => { | ||
| return params; | ||
| }; | ||
|
|
||
| export { filterApiQueryParams }; |
There was a problem hiding this comment.
Add a colocated unit test for this utility.
This new utility should have a colocated *.test.ts to validate the identity passthrough behavior (e.g., ensuring the same object reference is returned).
As per coding guidelines: Add unit tests in *.test.ts files colocated with source code for utility functions, helpers, business logic, data transformations, and hooks with complex logic.
🤖 Prompt for AI Agents
In `@packages/query/src/hooks/categories.ts` around lines 1 - 5, Add a colocated
unit test file for the filterApiQueryParams utility that asserts it returns the
exact same object reference passed in (identity passthrough). Create a file
named filterApiQueryParams.test.ts next to the source, import
filterApiQueryParams, call it with a single object instance and use a strict
identity assertion (e.g., expect(result).toBe(input)) and also include a simple
primitive or empty object case to cover edge inputs; ensure the test runs with
the repository test runner configuration.
| const filterApiQueryParams = (params: Record<string, unknown>) => { | ||
| return params; | ||
| }; | ||
|
|
||
| export { filterApiQueryParams }; |
There was a problem hiding this comment.
Add a colocated unit test for this utility.
This is a new utility function, but there’s no accompanying *.test.ts coverage shown. Please add a small test (e.g., verifying the identity passthrough behavior) in a colocated test file such as packages/query/src/hooks/tags.test.ts.
As per coding guidelines: Add unit tests in *.test.ts files colocated with source code for utility functions, helpers, business logic, data transformations, and hooks with complex logic.
🤖 Prompt for AI Agents
In `@packages/query/src/hooks/tags.ts` around lines 1 - 5, Add a colocated unit
test file packages/query/src/hooks/tags.test.ts that imports the
filterApiQueryParams function and asserts its identity passthrough behavior
(e.g., passing an object with various keys and verifying the returned value is
deeply equal to the input, and optionally that it returns the same reference
when appropriate). Name the test suite to reference filterApiQueryParams and
include at least one test case for a typical params object and one for an empty
object to cover edge cases.
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.