Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

no-rest-destructuring.utils.ts

11 lines382 Bytes

1import { AST_NODE_TYPES } from '@typescript-eslint/utils'
2import type { TSESTree } from '@typescript-eslint/utils'
3​
4export const NoRestDestructuringUtils = {
5 isObjectRestDestructuring(node: TSESTree.Node): boolean {
6 if (node.type !== AST_NODE_TYPES.ObjectPattern) {
7 return false
8 }
9 return node.properties.some((p) => p.type === AST_NODE_TYPES.RestElement)
10 },