Skip to content

Commit eaf3aba

Browse files
authored
Merge branch 'main' into react-query/test/infinite-query-options
2 parents 5a03df2 + eb341fc commit eaf3aba

File tree

7 files changed

+12
-19
lines changed

7 files changed

+12
-19
lines changed

examples/react/algolia/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"react-dom": "19.0.0-rc-4c2e457c7c-20240522"
1717
},
1818
"devDependencies": {
19-
"@tanstack/eslint-plugin-query": "^5.59.4",
19+
"@tanstack/eslint-plugin-query": "^5.59.7",
2020
"@types/react": "^18.2.79",
2121
"@types/react-dom": "^18.2.25",
2222
"@vitejs/plugin-react": "^4.3.1",

examples/react/basic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"react-dom": "19.0.0-rc-4c2e457c7c-20240522"
1818
},
1919
"devDependencies": {
20-
"@tanstack/eslint-plugin-query": "^5.59.4",
20+
"@tanstack/eslint-plugin-query": "^5.59.7",
2121
"@types/react": "^18.2.79",
2222
"@types/react-dom": "^18.2.25",
2323
"@vitejs/plugin-react": "^4.3.1",

examples/solid/simple/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"solid-js": "^1.8.19"
1515
},
1616
"devDependencies": {
17-
"@tanstack/eslint-plugin-query": "^5.59.4",
17+
"@tanstack/eslint-plugin-query": "^5.59.7",
1818
"typescript": "5.3.3",
1919
"vite": "^5.3.5",
2020
"vite-plugin-solid": "^2.10.2"

packages/eslint-plugin-query/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tanstack/eslint-plugin-query",
3-
"version": "5.59.4",
3+
"version": "5.59.7",
44
"description": "ESLint plugin for TanStack Query",
55
"author": "Eliya Cohen",
66
"license": "MIT",

packages/eslint-plugin-query/src/__tests__/infinite-query-property-order.rule.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const orderIndependentProps = [
2424
'queryKey',
2525
'...objectExpressionSpread',
2626
'...callExpressionSpread',
27+
'...memberCallExpressionSpread',
2728
] as const
2829
type OrderIndependentProps = (typeof orderIndependentProps)[number]
2930

@@ -147,6 +148,8 @@ function getCode({
147148
return `...objectExpressionSpread`
148149
case '...callExpressionSpread':
149150
return callExpressionSpread
151+
case '...memberCallExpressionSpread':
152+
return '...myOptions.infiniteQueryOptions()'
150153
case 'queryKey':
151154
return `queryKey: ['projects']`
152155
case 'queryFn':

packages/eslint-plugin-query/src/rules/infinite-query-property-order/infinite-query-property-order.rule.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,13 @@ export const rule = createRule({
5656
return
5757
}
5858

59-
const properties = allProperties.flatMap((p) => {
59+
const properties = allProperties.flatMap((p, index) => {
6060
if (
6161
p.type === AST_NODE_TYPES.Property &&
6262
p.key.type === AST_NODE_TYPES.Identifier
6363
) {
6464
return { name: p.key.name, property: p }
65-
} else if (p.type === AST_NODE_TYPES.SpreadElement) {
66-
if (p.argument.type === AST_NODE_TYPES.Identifier) {
67-
return { name: p.argument.name, property: p }
68-
} else if (p.argument.type === AST_NODE_TYPES.CallExpression) {
69-
if (p.argument.callee.type === AST_NODE_TYPES.Identifier) {
70-
return { name: p.argument.callee.name, property: p }
71-
}
72-
}
73-
throw new Error('Unsupported spread element')
74-
}
75-
return []
65+
} else return { name: `_property_${index}`, property: p }
7666
})
7767

7868
const sortedProperties = sortDataByOrder(properties, sortRules, 'name')

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)