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

mutation-property-order.rule.ts

31 lines800 Bytes

1import { createPropertyOrderRule } from '../../utils/create-property-order-rule'
2import { mutationFunctions, sortRules } from './constants'
3import type { MutationFunctions, MutationProperties } from './constants'
4​
5export const name = 'mutation-property-order'
6​
7export const rule = createPropertyOrderRule<
8 MutationFunctions,
9 MutationProperties
10>(
11 {
12 name,
13 meta: {
14 type: 'problem',
15 docs: {
16 description:
17 'Ensure correct order of inference-sensitive properties in useMutation()',
18 recommended: 'error',
19 },
20 messages: {
21 invalidOrder: 'Invalid order of properties for `{{function}}`.',
22 },
23 schema: [],
24 hasSuggestions: true,
25 fixable: 'code',
26 },
27 defaultOptions: [],
28 },
29 mutationFunctions,
30 sortRules,