WIP: generic type inference in table for core/external plugins without *_All or *_Internal types#6327
WIP: generic type inference in table for core/external plugins without *_All or *_Internal types#6327riccardoperra wants to merge 5 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
🚧 Files skipped from review as they are similar to previous changes (7)
📝 WalkthroughWalkthroughThis PR retypes table-core from internal ChangesPublic Table typing migration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~65 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
|
View your CI Pipeline Execution ↗ for commit d065ced
☁️ Nx Cloud last updated this comment at |
1872cf4 to
a0368e1
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts (1)
205-221:⚠️ Potential issue | 🟠 Major | ⚡ Quick winFiltered/grouped selected row-model helpers are reading the wrong source model.
On Line 210 and Line 239, both helpers use
table.getCoreRowModel(), which bypasses the pipeline stage implied by each API (filtered/grouped). This returns incorrect selected-row projections for those views.Suggested fix
export function table_getFilteredSelectedRowModel< @@ >(table: Table<TFeatures, TData>) { const featureTable = table as unknown as Table<RowSelectionFeatures, TData> - const rowModel = table.getCoreRowModel() + const rowModel = table.getFilteredRowModel() @@ export function table_getGroupedSelectedRowModel< @@ >(table: Table<TFeatures, TData>) { const featureTable = table as unknown as Table<RowSelectionFeatures, TData> - const rowModel = table.getCoreRowModel() + const rowModel = table.getGroupedRowModel()Also applies to: 234-250
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts` around lines 205 - 221, The table_getFilteredSelectedRowModel function is using table.getCoreRowModel() which bypasses filtering and returns the wrong row projection. Replace the getCoreRowModel() call with getFilteredRowModel() to use the properly filtered row model. Additionally, the same issue exists in the corresponding grouped helper function (also applies around line 234-250) where you should replace getCoreRowModel() with getGroupedRowModel() to use the properly grouped row model instead.packages/table-core/src/features/stockFeatures.ts (1)
17-32:⚠️ Potential issue | 🟡 MinorUse
typeof rowSelectionFeatureto match the typing pattern of all other features in the interface.Line 30 uses the bare
TableFeaturetype, losing the generic type parameter, while all other features (lines 18–29, 31) use thetypeof <featureName>pattern. ChangerowSelectionFeature: TableFeaturetorowSelectionFeature: typeof rowSelectionFeaturefor consistency.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/table-core/src/features/stockFeatures.ts` around lines 17 - 32, The StockFeatures interface has an inconsistent typing pattern where rowSelectionFeature uses the bare TableFeature type instead of the typeof pattern used by all other feature properties. Change the type annotation for rowSelectionFeature from TableFeature to typeof rowSelectionFeature to maintain consistency with the pattern used for columnFacetingFeature, columnFilteringFeature, columnGroupingFeature, columnOrderingFeature, columnPinningFeature, columnResizingFeature, columnSizingFeature, columnVisibilityFeature, globalFilteringFeature, rowExpandingFeature, rowPaginationFeature, rowPinningFeature, and rowSortingFeature.
🧹 Nitpick comments (1)
packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts (1)
791-796: ⚡ Quick winAlign
table_getPinnedLeafColumnssignature with documented behavior.At Line 794, the type excludes
false, but the docs and Line 795 branch explicitly handle falsy input (“all leaf columns”). Please make the signature match the supported behavior (or remove the branch/doc claim).Suggested fix
-export function table_getPinnedLeafColumns< +export function table_getPinnedLeafColumns< TFeatures extends TableFeatures, TData extends RowData, ->(table: Table<TFeatures, TData>, position: ColumnPinningPosition | 'center') { +>( + table: Table<TFeatures, TData>, + position?: ColumnPinningPosition | 'center' | false, +) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts` around lines 791 - 796, The type signature of the position parameter in the function table_getPinnedLeafColumns excludes false, but the implementation checks !position (line 795) to handle the falsy case and return all leaf columns. Update the position parameter type to include false or the appropriate falsy value type to align the signature with the actual implementation that handles falsy input, ensuring the documented behavior matches the type contract.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/table-core/src/features/column-faceting/columnFacetingFeature.ts`:
- Around line 16-20: The ColumnFacetingFeature type definition at lines 16-20
requires all three feature properties (columnFacetingFeature,
columnFilteringFeature, and globalFilteringFeature) to be present, which
over-constrains the feature inference when used in TableFeature at line 25. Fix
this by making the ColumnFacetingFeature type use Partial to make all properties
optional, allowing plugins to compose features flexibly without forcing
unrelated feature keys to exist in the feature set. This change at the type
definition will automatically resolve the over-constraining issue at the usage
site on line 25.
In `@packages/table-core/src/features/global-filtering/globalFilteringFeature.ts`:
- Line 30: Remove the explicit `any` type annotation from the `column` parameter
in the `getColumnCanGlobalFilter` callback. Instead of specifying `(column:
any)`, change it to `(column)` to allow TypeScript to properly infer the type as
`Column<TFeatures, TData, TValue>` from the interface contract, which will
preserve type information and enable better generic inference.
In `@packages/table-core/src/features/row-pagination/createPaginatedRowModel.ts`:
- Around line 33-38: The memoDeps array in the createPaginatedRowModel function
only tracks atoms.expanded when paginateExpandedRows is true, but the pagination
logic at line 69 applies expandRows after slicing regardless of the
paginateExpandedRows setting, meaning expanded state changes affect the result
even when paginateExpandedRows is false. Fix this by unconditionally including
featureTable.atoms.expanded?.get() in the memoDeps array instead of
conditionally adding it only when paginateExpandedRows is true, ensuring the
memoized pagination result is invalidated whenever the expanded state changes.
In `@packages/table-core/src/features/row-sorting/createSortedRowModel.ts`:
- Around line 60-62: The unsafe cast on line 61 in the sorting filter casts the
result of table.getColumn(sort.id) to Column before checking if it actually
exists, which causes column_getCanSort to receive undefined if the sort.id
references a missing column. Fix this by first checking that
table.getColumn(sort.id) returns a defined column before casting and passing it
to column_getCanSort. Add a null/undefined check within the filter predicate to
ensure the column exists before both the cast and the function call.
---
Outside diff comments:
In `@packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts`:
- Around line 205-221: The table_getFilteredSelectedRowModel function is using
table.getCoreRowModel() which bypasses filtering and returns the wrong row
projection. Replace the getCoreRowModel() call with getFilteredRowModel() to use
the properly filtered row model. Additionally, the same issue exists in the
corresponding grouped helper function (also applies around line 234-250) where
you should replace getCoreRowModel() with getGroupedRowModel() to use the
properly grouped row model instead.
In `@packages/table-core/src/features/stockFeatures.ts`:
- Around line 17-32: The StockFeatures interface has an inconsistent typing
pattern where rowSelectionFeature uses the bare TableFeature type instead of the
typeof pattern used by all other feature properties. Change the type annotation
for rowSelectionFeature from TableFeature to typeof rowSelectionFeature to
maintain consistency with the pattern used for columnFacetingFeature,
columnFilteringFeature, columnGroupingFeature, columnOrderingFeature,
columnPinningFeature, columnResizingFeature, columnSizingFeature,
columnVisibilityFeature, globalFilteringFeature, rowExpandingFeature,
rowPaginationFeature, rowPinningFeature, and rowSortingFeature.
---
Nitpick comments:
In
`@packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts`:
- Around line 791-796: The type signature of the position parameter in the
function table_getPinnedLeafColumns excludes false, but the implementation
checks !position (line 795) to handle the falsy case and return all leaf
columns. Update the position parameter type to include false or the appropriate
falsy value type to align the signature with the actual implementation that
handles falsy input, ensuring the documented behavior matches the type contract.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 40a4db68-bf26-4fcd-8d8d-34d79fc15320
📒 Files selected for processing (67)
packages/table-core/src/core/cells/constructCell.tspackages/table-core/src/core/cells/coreCellsFeature.types.tspackages/table-core/src/core/columns/constructColumn.tspackages/table-core/src/core/columns/coreColumnsFeature.tspackages/table-core/src/core/columns/coreColumnsFeature.types.tspackages/table-core/src/core/columns/coreColumnsFeature.utils.tspackages/table-core/src/core/headers/buildHeaderGroups.tspackages/table-core/src/core/headers/constructHeader.tspackages/table-core/src/core/headers/coreHeadersFeature.tspackages/table-core/src/core/headers/coreHeadersFeature.utils.tspackages/table-core/src/core/row-models/coreRowModelsFeature.tspackages/table-core/src/core/row-models/coreRowModelsFeature.utils.tspackages/table-core/src/core/row-models/createCoreRowModel.tspackages/table-core/src/core/rows/constructRow.tspackages/table-core/src/core/rows/coreRowsFeature.tspackages/table-core/src/core/rows/coreRowsFeature.types.tspackages/table-core/src/core/rows/coreRowsFeature.utils.tspackages/table-core/src/core/table/constructTable.tspackages/table-core/src/core/table/coreTablesFeature.types.tspackages/table-core/src/core/table/coreTablesFeature.utils.tspackages/table-core/src/features/column-faceting/columnFacetingFeature.tspackages/table-core/src/features/column-faceting/columnFacetingFeature.utils.tspackages/table-core/src/features/column-faceting/createFacetedMinMaxValues.tspackages/table-core/src/features/column-faceting/createFacetedRowModel.tspackages/table-core/src/features/column-faceting/createFacetedUniqueValues.tspackages/table-core/src/features/column-filtering/columnFilteringFeature.utils.tspackages/table-core/src/features/column-filtering/createFilteredRowModel.tspackages/table-core/src/features/column-filtering/filterRowsUtils.tspackages/table-core/src/features/column-grouping/columnGroupingFeature.utils.tspackages/table-core/src/features/column-grouping/createGroupedRowModel.tspackages/table-core/src/features/column-ordering/columnOrderingFeature.utils.tspackages/table-core/src/features/column-pinning/columnPinningFeature.utils.tspackages/table-core/src/features/column-resizing/columnResizingFeature.utils.tspackages/table-core/src/features/column-sizing/columnSizingFeature.utils.tspackages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.tspackages/table-core/src/features/global-filtering/globalFilteringFeature.tspackages/table-core/src/features/global-filtering/globalFilteringFeature.utils.tspackages/table-core/src/features/row-expanding/createExpandedRowModel.tspackages/table-core/src/features/row-expanding/rowExpandingFeature.utils.tspackages/table-core/src/features/row-pagination/createPaginatedRowModel.tspackages/table-core/src/features/row-pagination/rowPaginationFeature.utils.tspackages/table-core/src/features/row-pinning/rowPinningFeature.utils.tspackages/table-core/src/features/row-selection/rowSelectionFeature.tspackages/table-core/src/features/row-selection/rowSelectionFeature.types.tspackages/table-core/src/features/row-selection/rowSelectionFeature.utils.tspackages/table-core/src/features/row-sorting/createSortedRowModel.tspackages/table-core/src/features/row-sorting/rowSortingFeature.utils.tspackages/table-core/src/features/stockFeatures.tspackages/table-core/src/types/Column.tspackages/table-core/src/types/ColumnDef.tspackages/table-core/src/types/RowModel.tspackages/table-core/src/types/RowModelFns.tspackages/table-core/src/types/Table.tspackages/table-core/src/types/TableFeatures.tspackages/table-core/src/types/TableOptions.tspackages/table-core/src/types/TableState.tspackages/table-core/src/utils.tspackages/table-core/tests/declaration-emit/tableOptions.tspackages/table-core/tests/helpers/generateTestTable.tspackages/table-core/tests/helpers/rowPinningHelpers.tspackages/table-core/tests/unit/core/cells/constructCell.test.tspackages/table-core/tests/unit/core/columns/constructColumn.test.tspackages/table-core/tests/unit/core/headers/constructHeader.test.tspackages/table-core/tests/unit/core/rows/constructRow.test.tspackages/table-core/tests/unit/core/tableAtoms.test.tspackages/table-core/tests/unit/features/column-pinning/columnPinningFeature.utils.test.tspackages/table-core/tsconfig.json
💤 Files with no reviewable changes (4)
- packages/table-core/src/types/RowModelFns.ts
- packages/table-core/src/types/ColumnDef.ts
- packages/table-core/src/types/TableState.ts
- packages/table-core/src/types/Column.ts
| type ColumnFacetingFeature = { | ||
| columnFacetingFeature: TableFeature | ||
| columnFilteringFeature: TableFeature | ||
| globalFilteringFeature: TableFeature | ||
| } |
There was a problem hiding this comment.
Use a partial feature map here to avoid over-constraining plugin feature inference.
ColumnFacetingFeature is currently required at Line 16-20, so TableFeature<ColumnFacetingFeature> at Line 25 forces unrelated feature keys to exist in the feature set. That can break the intended “core/external plugin” generic inference path.
Suggested fix
-type ColumnFacetingFeature = {
+type ColumnFacetingFeature = Partial<{
columnFacetingFeature: TableFeature
columnFilteringFeature: TableFeature
globalFilteringFeature: TableFeature
-}
+}>Also applies to: 25-25
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/table-core/src/features/column-faceting/columnFacetingFeature.ts`
around lines 16 - 20, The ColumnFacetingFeature type definition at lines 16-20
requires all three feature properties (columnFacetingFeature,
columnFilteringFeature, and globalFilteringFeature) to be present, which
over-constrains the feature inference when used in TableFeature at line 25. Fix
this by making the ColumnFacetingFeature type use Partial to make all properties
optional, allowing plugins to compose features flexibly without forcing
unrelated feature keys to exist in the feature set. This change at the type
definition will automatically resolve the over-constraining issue at the usage
site on line 25.
| onGlobalFilterChange: makeStateUpdater('globalFilter', table), | ||
| globalFilterFn: 'auto', | ||
| getColumnCanGlobalFilter: (column) => { | ||
| getColumnCanGlobalFilter: (column: any) => { |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify the declared callback type and compare implementations.
rg -n --type=ts -C3 '\bgetColumnCanGlobalFilter\b' packages/table-core/src/types packages/table-core/src/featuresRepository: TanStack/table
Length of output: 3615
🏁 Script executed:
cat -n packages/table-core/src/features/global-filtering/globalFilteringFeature.types.ts | sed -n '45,55p'Repository: TanStack/table
Length of output: 506
Remove explicit any type from getColumnCanGlobalFilter callback parameter.
The getColumnCanGlobalFilter option contract defines the callback parameter as Column<TFeatures, TData, TValue>, a properly typed generic. Using any discards this type information and weakens the generic inference that this PR improves. Remove the explicit type annotation to allow proper inference from the interface contract.
Suggested change
- getColumnCanGlobalFilter: (column: any) => {
+ getColumnCanGlobalFilter: (column) => {📝 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.
| getColumnCanGlobalFilter: (column: any) => { | |
| getColumnCanGlobalFilter: (column) => { |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/table-core/src/features/global-filtering/globalFilteringFeature.ts`
at line 30, Remove the explicit `any` type annotation from the `column`
parameter in the `getColumnCanGlobalFilter` callback. Instead of specifying
`(column: any)`, change it to `(column)` to allow TypeScript to properly infer
the type as `Column<TFeatures, TData, TValue>` from the interface contract,
which will preserve type information and enable better generic inference.
| memoDeps: () => [ | ||
| table.getPrePaginatedRowModel(), | ||
| table.atoms.pagination?.get(), | ||
| table.options.paginateExpandedRows | ||
| ? table.atoms.expanded?.get() | ||
| featureTable.atoms.pagination?.get(), | ||
| featureTable.options.paginateExpandedRows | ||
| ? featureTable.atoms.expanded?.get() | ||
| : undefined, |
There was a problem hiding this comment.
Fix stale pagination memo when paginateExpandedRows is false.
At Line 69, paginated output depends on expanded state when paginateExpandedRows is false (expandRows(...) is applied after slicing). But Lines 36–38 only track atoms.expanded when paginateExpandedRows is true, so expanded toggles can leave getPaginatedRowModel() stale.
Suggested fix
memoDeps: () => [
table.getPrePaginatedRowModel(),
featureTable.atoms.pagination?.get(),
- featureTable.options.paginateExpandedRows
+ !featureTable.options.paginateExpandedRows
? featureTable.atoms.expanded?.get()
: undefined,
],Also applies to: 69-75
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/table-core/src/features/row-pagination/createPaginatedRowModel.ts`
around lines 33 - 38, The memoDeps array in the createPaginatedRowModel function
only tracks atoms.expanded when paginateExpandedRows is true, but the pagination
logic at line 69 applies expandRows after slicing regardless of the
paginateExpandedRows setting, meaning expanded state changes affect the result
even when paginateExpandedRows is false. Fix this by unconditionally including
featureTable.atoms.expanded?.get() in the memoDeps array instead of
conditionally adding it only when paginateExpandedRows is true, ensuring the
memoized pagination result is invalidated whenever the expanded state changes.
| const availableSorting = sorting.filter((sort) => | ||
| column_getCanSort( | ||
| table.getColumn(sort.id) as Column_Internal<TFeatures, TData>, | ||
| ), | ||
| column_getCanSort(table.getColumn(sort.id) as Column<TFeatures, TData>), | ||
| ) |
There was a problem hiding this comment.
Unsafe cast can crash when sorting references a missing column.
On Line 61, table.getColumn(sort.id) is cast to Column before nullability is checked. If a stale/unknown sort.id exists, column_getCanSort can dereference undefined.
Suggested fix
- const availableSorting = sorting.filter((sort) =>
- column_getCanSort(table.getColumn(sort.id) as Column<TFeatures, TData>),
- )
+ const availableSorting = sorting.filter((sort) => {
+ const column = table.getColumn(sort.id)
+ return column ? column_getCanSort(column) : false
+ })📝 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.
| const availableSorting = sorting.filter((sort) => | |
| column_getCanSort( | |
| table.getColumn(sort.id) as Column_Internal<TFeatures, TData>, | |
| ), | |
| column_getCanSort(table.getColumn(sort.id) as Column<TFeatures, TData>), | |
| ) | |
| const availableSorting = sorting.filter((sort) => { | |
| const column = table.getColumn(sort.id) | |
| return column ? column_getCanSort(column) : false | |
| }) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/table-core/src/features/row-sorting/createSortedRowModel.ts` around
lines 60 - 62, The unsafe cast on line 61 in the sorting filter casts the result
of table.getColumn(sort.id) to Column before checking if it actually exists,
which causes column_getCanSort to receive undefined if the sort.id references a
missing column. Fix this by first checking that table.getColumn(sort.id) returns
a defined column before casting and passing it to column_getCanSort. Add a
null/undefined check within the filter predicate to ensure the column exists
before both the cast and the function call.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/table-core/src/core/headers/coreHeadersFeature.utils.ts (1)
174-174: 💤 Low valueConsider aligning the assertion style for consistency.
Line 174 uses an explicit type assertion (
as Header<...>), while line 200 uses a non-null assertion (!) when pushing to identically typed result arrays. If the type cast on line 174 is necessary due toheaderGroups[i]!.headerscontaining an internal header variant, this is fine. However, if both could use non-null assertions, that would improve consistency and maintainability.Also applies to: 200-200
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/table-core/src/core/headers/coreHeadersFeature.utils.ts` at line 174, The code uses inconsistent assertion styles when pushing to the result array - one location uses an explicit type assertion with `as Header<TFeatures, TData, unknown>` while another location uses a non-null assertion with `!`. Align these to use the same assertion style for consistency and maintainability. If the explicit type assertion is necessary because the source type differs from the target type, retain it as is; otherwise, update both locations to consistently use non-null assertions instead of the explicit type cast.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/table-core/src/core/headers/coreHeadersFeature.utils.ts`:
- Line 174: The code uses inconsistent assertion styles when pushing to the
result array - one location uses an explicit type assertion with `as
Header<TFeatures, TData, unknown>` while another location uses a non-null
assertion with `!`. Align these to use the same assertion style for consistency
and maintainability. If the explicit type assertion is necessary because the
source type differs from the target type, retain it as is; otherwise, update
both locations to consistently use non-null assertions instead of the explicit
type cast.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 086858f5-ddc5-40ce-a0db-3c47b1e7aeed
📒 Files selected for processing (14)
packages/table-core/src/core/columns/coreColumnsFeature.tspackages/table-core/src/core/headers/coreHeadersFeature.utils.tspackages/table-core/src/core/row-models/coreRowModelsFeature.utils.tspackages/table-core/src/core/table/constructTable.tspackages/table-core/src/features/column-faceting/columnFacetingFeature.tspackages/table-core/src/features/column-faceting/createFacetedMinMaxValues.tspackages/table-core/src/features/column-faceting/createFacetedRowModel.tspackages/table-core/src/features/column-faceting/createFacetedUniqueValues.tspackages/table-core/src/features/column-grouping/createGroupedRowModel.tspackages/table-core/src/features/row-expanding/createExpandedRowModel.tspackages/table-core/src/features/row-expanding/rowExpandingFeature.utils.tspackages/table-core/src/features/row-selection/rowSelectionFeature.utils.tspackages/table-core/src/types/Table.tspackages/table-core/src/types/TableFeatures.ts
✅ Files skipped from review due to trivial changes (1)
- packages/table-core/src/features/column-faceting/createFacetedMinMaxValues.ts
🚧 Files skipped from review as they are similar to previous changes (11)
- packages/table-core/src/features/column-faceting/columnFacetingFeature.ts
- packages/table-core/src/features/column-faceting/createFacetedUniqueValues.ts
- packages/table-core/src/features/column-grouping/createGroupedRowModel.ts
- packages/table-core/src/core/table/constructTable.ts
- packages/table-core/src/features/row-expanding/createExpandedRowModel.ts
- packages/table-core/src/types/Table.ts
- packages/table-core/src/types/TableFeatures.ts
- packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts
- packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts
- packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts
- packages/table-core/src/features/column-faceting/createFacetedRowModel.ts
3351f3e to
f603b34
Compare
There was a problem hiding this comment.
Nx Cloud is proposing a fix for your failed CI:
We fixed three ESLint errors introduced by the PR's type refactoring: two @typescript-eslint/no-unnecessary-type-assertion violations where as Column<...> and as Array<Column<...>> casts became redundant after switching from Table_Internal to the public Table type, and one import/newline-after-import violation where a newly added type declaration was missing a blank line after the last import. These changes restore ESLint compliance without altering any runtime behavior.
Tip
✅ We verified this fix by re-running @tanstack/table-core:test:eslint.
Suggested Fix changes
diff --git a/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts b/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts
index 48423337..c2f34a79 100644
--- a/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts
+++ b/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts
@@ -212,7 +212,7 @@ export function table_getAllLeafColumns<
table,
'getOrderColumns',
table_getOrderColumnsFn,
- )(leafColumns) as Array<Column<TFeatures, TData, unknown>>
+ )(leafColumns)
}
/**
diff --git a/packages/table-core/src/features/column-grouping/createGroupedRowModel.ts b/packages/table-core/src/features/column-grouping/createGroupedRowModel.ts
index 7c4e5617..fb5e21a9 100644
--- a/packages/table-core/src/features/column-grouping/createGroupedRowModel.ts
+++ b/packages/table-core/src/features/column-grouping/createGroupedRowModel.ts
@@ -160,9 +160,7 @@ function _createGroupedRowModel<
// Aggregate the values
const column = table.getColumn(colId)
const aggregateFn = column
- ? column_getAggregationFn(
- column as Column<TFeatures, TData, unknown>,
- )
+ ? column_getAggregationFn(column)
: undefined
if (!row._groupingValuesCache) row._groupingValuesCache = {}
diff --git a/packages/table-core/src/features/row-expanding/createExpandedRowModel.ts b/packages/table-core/src/features/row-expanding/createExpandedRowModel.ts
index eb6ea9ec..9762baf4 100644
--- a/packages/table-core/src/features/row-expanding/createExpandedRowModel.ts
+++ b/packages/table-core/src/features/row-expanding/createExpandedRowModel.ts
@@ -5,6 +5,7 @@ import type { RowModel } from '../../core/row-models/coreRowModelsFeature.types'
import type { Table } from '../../types/Table'
import type { Row } from '../../types/Row'
import type { RowData } from '../../types/type-utils'
+
type ExpandedRowModelFeatures = Partial<{ rowExpandingFeature: TableFeature }>
/**
Or Apply changes locally with:
npx nx-cloud apply-locally m5Ok-vXiA
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
Summary by CodeRabbit