Skip to content
Source
Sign inSign up
TanStack/query

feat(eslint-plugin): add mutation-property-order rule and tests #9186

Closedjochongs(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/9186/headopened View on GitHub

Showing 6 changed files with 225 additions and 0 deletions (loading 4).

x
0 of 6 viewed, 6 left
218 additions and 0 deletionspackages/eslint-plugin-query/src/__tests__/mutation-property-order.rule.test.tsAdded
View file
@@ -0,0 +1,218 @@
+import { RuleTester } from '@typescript-eslint/rule-tester'
+import combinate from 'combinate'
+​
+import {
+ checkedProperties,
+ mutationFunctions,
+} from '../rules/mutation-property-order/constants'
+import {
+ name,
+ rule,
+} from '../rules/mutation-property-order/mutation-property-order.rule'
+import {
+ generateInterleavedCombinations,
+ generatePartialCombinations,
+ generatePermutations,
+ normalizeIndent,
+} from './test-utils'
+import type { MutationFunctions } from '../rules/mutation-property-order/constants'
+​
+const ruleTester = new RuleTester()
+​
+type CheckedProperties = (typeof checkedProperties)[number]
+const orderIndependentProps = [
+ 'gcTime',
+ '...objectExpressionSpread',
+ '...callExpressionSpread',
+ '...memberCallExpressionSpread',