@vitest/eslint-plugin 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { isAbsolute, posix } from "node:path";
4
4
  import { DefinitionType } from "@typescript-eslint/scope-manager";
5
5
 
6
6
  //#region package.json
7
- var version = "1.4.1";
7
+ var version = "1.4.3";
8
8
 
9
9
  //#endregion
10
10
  //#region src/utils/index.ts
@@ -84,11 +84,11 @@ const isParsedInstanceOfMatcherCall = (expectFnCall, classArg) => {
84
84
 
85
85
  //#endregion
86
86
  //#region src/rules/consistent-test-filename.ts
87
- const RULE_NAME$73 = "consistent-test-filename";
87
+ const RULE_NAME$74 = "consistent-test-filename";
88
88
  const defaultPattern = /.*\.test\.[tj]sx?$/;
89
89
  const defaultTestsPattern = /.*\.(test|spec)\.[tj]sx?$/;
90
90
  var consistent_test_filename_default = createEslintRule({
91
- name: RULE_NAME$73,
91
+ name: RULE_NAME$74,
92
92
  meta: {
93
93
  type: "problem",
94
94
  docs: {
@@ -1830,7 +1830,7 @@ const followTypeAssertionChain$1 = (expression) => isTypeCastExpression$1(expres
1830
1830
 
1831
1831
  //#endregion
1832
1832
  //#region src/rules/consistent-test-it.ts
1833
- const RULE_NAME$72 = "consistent-test-it";
1833
+ const RULE_NAME$73 = "consistent-test-it";
1834
1834
  const buildFixer = (callee, nodeName, preferredTestKeyword) => (fixer) => [fixer.replaceText(callee.type === AST_NODE_TYPES.MemberExpression ? callee.object : callee, getPreferredNodeName(nodeName, preferredTestKeyword))];
1835
1835
  function getPreferredNodeName(nodeName, preferredTestKeyword) {
1836
1836
  if (nodeName === TestCaseName.fit) return "test.only";
@@ -1841,7 +1841,7 @@ function getOppositeTestKeyword(test) {
1841
1841
  return TestCaseName.test;
1842
1842
  }
1843
1843
  var consistent_test_it_default = createEslintRule({
1844
- name: RULE_NAME$72,
1844
+ name: RULE_NAME$73,
1845
1845
  meta: {
1846
1846
  type: "suggestion",
1847
1847
  fixable: "code",
@@ -1946,10 +1946,10 @@ var consistent_test_it_default = createEslintRule({
1946
1946
 
1947
1947
  //#endregion
1948
1948
  //#region src/rules/consistent-vitest-vi.ts
1949
- const RULE_NAME$71 = "consistent-vitest-vi";
1949
+ const RULE_NAME$72 = "consistent-vitest-vi";
1950
1950
  const getOppositeVitestUtilKeyword = (util) => util === UtilName.vi ? UtilName.vitest : UtilName.vi;
1951
1951
  var consistent_vitest_vi_default = createEslintRule({
1952
- name: RULE_NAME$71,
1952
+ name: RULE_NAME$72,
1953
1953
  meta: {
1954
1954
  type: "suggestion",
1955
1955
  fixable: "code",
@@ -2029,9 +2029,9 @@ function parsePluginSettings(settings) {
2029
2029
 
2030
2030
  //#endregion
2031
2031
  //#region src/rules/expect-expect.ts
2032
- const RULE_NAME$70 = "expect-expect";
2032
+ const RULE_NAME$71 = "expect-expect";
2033
2033
  var expect_expect_default = createEslintRule({
2034
- name: RULE_NAME$70,
2034
+ name: RULE_NAME$71,
2035
2035
  meta: {
2036
2036
  type: "suggestion",
2037
2037
  docs: {
@@ -2104,14 +2104,14 @@ function buildPatternRegexp(pattern) {
2104
2104
 
2105
2105
  //#endregion
2106
2106
  //#region src/rules/hoisted-apis-on-top.ts
2107
- const RULE_NAME$69 = "hoisted-apis-on-top";
2107
+ const RULE_NAME$70 = "hoisted-apis-on-top";
2108
2108
  const hoistedAPIs = [
2109
2109
  "mock",
2110
2110
  "hoisted",
2111
2111
  "unmock"
2112
2112
  ];
2113
2113
  var hoisted_apis_on_top_default = createEslintRule({
2114
- name: RULE_NAME$69,
2114
+ name: RULE_NAME$70,
2115
2115
  meta: {
2116
2116
  hasSuggestions: true,
2117
2117
  type: "suggestion",
@@ -2178,9 +2178,9 @@ var hoisted_apis_on_top_default = createEslintRule({
2178
2178
 
2179
2179
  //#endregion
2180
2180
  //#region src/rules/max-expects.ts
2181
- const RULE_NAME$68 = "max-expects";
2181
+ const RULE_NAME$69 = "max-expects";
2182
2182
  var max_expects_default = createEslintRule({
2183
- name: RULE_NAME$68,
2183
+ name: RULE_NAME$69,
2184
2184
  meta: {
2185
2185
  docs: {
2186
2186
  requiresTypeChecking: false,
@@ -2225,9 +2225,9 @@ var max_expects_default = createEslintRule({
2225
2225
 
2226
2226
  //#endregion
2227
2227
  //#region src/rules/max-nested-describe.ts
2228
- const RULE_NAME$67 = "max-nested-describe";
2228
+ const RULE_NAME$68 = "max-nested-describe";
2229
2229
  var max_nested_describe_default = createEslintRule({
2230
- name: RULE_NAME$67,
2230
+ name: RULE_NAME$68,
2231
2231
  meta: {
2232
2232
  type: "problem",
2233
2233
  docs: {
@@ -2269,9 +2269,9 @@ var max_nested_describe_default = createEslintRule({
2269
2269
 
2270
2270
  //#endregion
2271
2271
  //#region src/rules/no-alias-methods.ts
2272
- const RULE_NAME$66 = "no-alias-methods";
2272
+ const RULE_NAME$67 = "no-alias-methods";
2273
2273
  var no_alias_methods_default = createEslintRule({
2274
- name: RULE_NAME$66,
2274
+ name: RULE_NAME$67,
2275
2275
  meta: {
2276
2276
  docs: {
2277
2277
  description: "disallow alias methods",
@@ -2321,12 +2321,12 @@ var no_alias_methods_default = createEslintRule({
2321
2321
 
2322
2322
  //#endregion
2323
2323
  //#region src/rules/no-commented-out-tests.ts
2324
- const RULE_NAME$65 = "no-commented-out-tests";
2324
+ const RULE_NAME$66 = "no-commented-out-tests";
2325
2325
  function hasTests(node) {
2326
2326
  return /^\s*[xf]?(test|it|describe)(\.\w+|\[['"]\w+['"]\])?\s*\(/mu.test(node.value);
2327
2327
  }
2328
2328
  var no_commented_out_tests_default = createEslintRule({
2329
- name: RULE_NAME$65,
2329
+ name: RULE_NAME$66,
2330
2330
  meta: {
2331
2331
  docs: {
2332
2332
  description: "disallow commented out tests",
@@ -2355,10 +2355,10 @@ var no_commented_out_tests_default = createEslintRule({
2355
2355
 
2356
2356
  //#endregion
2357
2357
  //#region src/rules/no-conditional-expect.ts
2358
- const RULE_NAME$64 = "no-conditional-expect";
2358
+ const RULE_NAME$65 = "no-conditional-expect";
2359
2359
  const isCatchCall = (node) => node.callee.type === AST_NODE_TYPES.MemberExpression && isSupportedAccessor(node.callee.property, "catch");
2360
2360
  var no_conditional_expect_default = createEslintRule({
2361
- name: RULE_NAME$64,
2361
+ name: RULE_NAME$65,
2362
2362
  meta: {
2363
2363
  type: "problem",
2364
2364
  docs: {
@@ -2413,9 +2413,9 @@ var no_conditional_expect_default = createEslintRule({
2413
2413
 
2414
2414
  //#endregion
2415
2415
  //#region src/rules/no-conditional-in-test.ts
2416
- const RULE_NAME$63 = "no-conditional-in-test";
2416
+ const RULE_NAME$64 = "no-conditional-in-test";
2417
2417
  var no_conditional_in_test_default = createEslintRule({
2418
- name: RULE_NAME$63,
2418
+ name: RULE_NAME$64,
2419
2419
  meta: {
2420
2420
  docs: {
2421
2421
  description: "disallow conditional tests",
@@ -2439,9 +2439,9 @@ var no_conditional_in_test_default = createEslintRule({
2439
2439
 
2440
2440
  //#endregion
2441
2441
  //#region src/rules/no-conditional-tests.ts
2442
- const RULE_NAME$62 = "no-conditional-tests";
2442
+ const RULE_NAME$63 = "no-conditional-tests";
2443
2443
  var no_conditional_tests_default = createEslintRule({
2444
- name: RULE_NAME$62,
2444
+ name: RULE_NAME$63,
2445
2445
  meta: {
2446
2446
  type: "problem",
2447
2447
  docs: {
@@ -2470,9 +2470,9 @@ var no_conditional_tests_default = createEslintRule({
2470
2470
 
2471
2471
  //#endregion
2472
2472
  //#region src/rules/no-disabled-tests.ts
2473
- const RULE_NAME$61 = "no-disabled-tests";
2473
+ const RULE_NAME$62 = "no-disabled-tests";
2474
2474
  var no_disabled_tests_default = createEslintRule({
2475
- name: RULE_NAME$61,
2475
+ name: RULE_NAME$62,
2476
2476
  meta: {
2477
2477
  type: "suggestion",
2478
2478
  docs: {
@@ -2538,7 +2538,7 @@ var no_disabled_tests_default = createEslintRule({
2538
2538
 
2539
2539
  //#endregion
2540
2540
  //#region src/rules/no-done-callback.ts
2541
- const RULE_NAME$60 = "no-done-callback";
2541
+ const RULE_NAME$61 = "no-done-callback";
2542
2542
  const findCallbackArg = (node, isVitestEach, context) => {
2543
2543
  if (isVitestEach) return node.arguments[1];
2544
2544
  const vitestFnCall = parseVitestFnCall(node, context);
@@ -2547,7 +2547,7 @@ const findCallbackArg = (node, isVitestEach, context) => {
2547
2547
  return null;
2548
2548
  };
2549
2549
  var no_done_callback_default = createEslintRule({
2550
- name: RULE_NAME$60,
2550
+ name: RULE_NAME$61,
2551
2551
  meta: {
2552
2552
  type: "suggestion",
2553
2553
  docs: {
@@ -2632,9 +2632,9 @@ var no_done_callback_default = createEslintRule({
2632
2632
 
2633
2633
  //#endregion
2634
2634
  //#region src/rules/no-duplicate-hooks.ts
2635
- const RULE_NAME$59 = "no-duplicate-hooks";
2635
+ const RULE_NAME$60 = "no-duplicate-hooks";
2636
2636
  var no_duplicate_hooks_default = createEslintRule({
2637
- name: RULE_NAME$59,
2637
+ name: RULE_NAME$60,
2638
2638
  meta: {
2639
2639
  docs: {
2640
2640
  recommended: false,
@@ -2671,7 +2671,7 @@ var no_duplicate_hooks_default = createEslintRule({
2671
2671
 
2672
2672
  //#endregion
2673
2673
  //#region src/rules/no-focused-tests.ts
2674
- const RULE_NAME$58 = "no-focused-tests";
2674
+ const RULE_NAME$59 = "no-focused-tests";
2675
2675
  const isTestOrDescribe = (node) => {
2676
2676
  return node.type === "Identifier" && [
2677
2677
  "it",
@@ -2683,7 +2683,7 @@ const isOnly = (node) => {
2683
2683
  return node.type === "Identifier" && node.name === "only";
2684
2684
  };
2685
2685
  var no_focused_tests_default = createEslintRule({
2686
- name: RULE_NAME$58,
2686
+ name: RULE_NAME$59,
2687
2687
  meta: {
2688
2688
  type: "problem",
2689
2689
  docs: {
@@ -2743,9 +2743,9 @@ var no_focused_tests_default = createEslintRule({
2743
2743
 
2744
2744
  //#endregion
2745
2745
  //#region src/rules/no-hooks.ts
2746
- const RULE_NAME$57 = "no-hooks";
2746
+ const RULE_NAME$58 = "no-hooks";
2747
2747
  var no_hooks_default = createEslintRule({
2748
- name: RULE_NAME$57,
2748
+ name: RULE_NAME$58,
2749
2749
  meta: {
2750
2750
  type: "suggestion",
2751
2751
  docs: {
@@ -2756,12 +2756,18 @@ var no_hooks_default = createEslintRule({
2756
2756
  type: "object",
2757
2757
  properties: { allow: {
2758
2758
  type: "array",
2759
- contains: [
2760
- "beforeAll",
2761
- "beforeEach",
2762
- "afterAll",
2763
- "afterEach"
2764
- ]
2759
+ items: {
2760
+ type: "string",
2761
+ enum: [
2762
+ HookName.beforeAll,
2763
+ HookName.beforeEach,
2764
+ HookName.afterAll,
2765
+ HookName.afterEach
2766
+ ]
2767
+ },
2768
+ additionalItems: false,
2769
+ uniqueItems: true,
2770
+ description: "This array option controls which Vitest hooks are checked by this rule."
2765
2771
  } },
2766
2772
  additionalProperties: false
2767
2773
  }],
@@ -2782,13 +2788,13 @@ var no_hooks_default = createEslintRule({
2782
2788
 
2783
2789
  //#endregion
2784
2790
  //#region src/rules/no-identical-title.ts
2785
- const RULE_NAME$56 = "no-identical-title";
2791
+ const RULE_NAME$57 = "no-identical-title";
2786
2792
  const newDescribeContext = () => ({
2787
2793
  describeTitles: [],
2788
2794
  testTitles: []
2789
2795
  });
2790
2796
  var no_identical_title_default = createEslintRule({
2791
- name: RULE_NAME$56,
2797
+ name: RULE_NAME$57,
2792
2798
  meta: {
2793
2799
  type: "problem",
2794
2800
  docs: {
@@ -2838,9 +2844,9 @@ var no_identical_title_default = createEslintRule({
2838
2844
 
2839
2845
  //#endregion
2840
2846
  //#region src/rules/no-import-node-test.ts
2841
- const RULE_NAME$55 = "no-import-node-test";
2847
+ const RULE_NAME$56 = "no-import-node-test";
2842
2848
  var no_import_node_test_default = createEslintRule({
2843
- name: RULE_NAME$55,
2849
+ name: RULE_NAME$56,
2844
2850
  meta: {
2845
2851
  docs: {
2846
2852
  description: "disallow importing `node:test`",
@@ -2937,9 +2943,9 @@ const removeNodeFromArray = (fixer, nodes, target) => {
2937
2943
 
2938
2944
  //#endregion
2939
2945
  //#region src/rules/no-importing-vitest-globals.ts
2940
- const RULE_NAME$54 = "no-importing-vitest-globals";
2946
+ const RULE_NAME$55 = "no-importing-vitest-globals";
2941
2947
  var no_importing_vitest_globals_default = createEslintRule({
2942
- name: RULE_NAME$54,
2948
+ name: RULE_NAME$55,
2943
2949
  meta: {
2944
2950
  type: "suggestion",
2945
2951
  docs: {
@@ -2995,9 +3001,9 @@ var no_importing_vitest_globals_default = createEslintRule({
2995
3001
 
2996
3002
  //#endregion
2997
3003
  //#region src/rules/no-interpolation-in-snapshots.ts
2998
- const RULE_NAME$53 = "no-interpolation-in-snapshots";
3004
+ const RULE_NAME$54 = "no-interpolation-in-snapshots";
2999
3005
  var no_interpolation_in_snapshots_default = createEslintRule({
3000
- name: RULE_NAME$53,
3006
+ name: RULE_NAME$54,
3001
3007
  meta: {
3002
3008
  type: "problem",
3003
3009
  docs: {
@@ -3025,7 +3031,7 @@ var no_interpolation_in_snapshots_default = createEslintRule({
3025
3031
 
3026
3032
  //#endregion
3027
3033
  //#region src/rules/no-large-snapshots.ts
3028
- const RULE_NAME$52 = "no-large-snapshots";
3034
+ const RULE_NAME$53 = "no-large-snapshots";
3029
3035
  const reportOnViolation = (context, node, { maxSize: lineLimit = 50, allowedSnapshots = {} }) => {
3030
3036
  const startLine = node.loc.start.line;
3031
3037
  const lineCount = node.loc.end.line - startLine;
@@ -3051,7 +3057,7 @@ const reportOnViolation = (context, node, { maxSize: lineLimit = 50, allowedSnap
3051
3057
  });
3052
3058
  };
3053
3059
  var no_large_snapshots_default = createEslintRule({
3054
- name: RULE_NAME$52,
3060
+ name: RULE_NAME$53,
3055
3061
  meta: {
3056
3062
  docs: {
3057
3063
  description: "disallow large snapshots",
@@ -3096,9 +3102,9 @@ var no_large_snapshots_default = createEslintRule({
3096
3102
  const mocksDirName = "__mocks__";
3097
3103
  const isMockPath = (path) => path.split(posix.sep).includes(mocksDirName);
3098
3104
  const isMockImportLiteral = (expression) => isStringNode(expression) && isMockPath(getStringValue(expression));
3099
- const RULE_NAME$51 = "no-mocks-import";
3105
+ const RULE_NAME$52 = "no-mocks-import";
3100
3106
  var no_mocks_import_default = createEslintRule({
3101
- name: RULE_NAME$51,
3107
+ name: RULE_NAME$52,
3102
3108
  meta: {
3103
3109
  type: "problem",
3104
3110
  docs: {
@@ -3130,13 +3136,13 @@ var no_mocks_import_default = createEslintRule({
3130
3136
 
3131
3137
  //#endregion
3132
3138
  //#region src/rules/no-restricted-matchers.ts
3133
- const RULE_NAME$50 = "no-restricted-matchers";
3139
+ const RULE_NAME$51 = "no-restricted-matchers";
3134
3140
  const isChainRestricted = (chain, restriction) => {
3135
3141
  if (Object.prototype.hasOwnProperty.call(ModifierName, restriction) || restriction.endsWith(".not")) return chain.startsWith(restriction);
3136
3142
  return chain === restriction;
3137
3143
  };
3138
3144
  var no_restricted_matchers_default = createEslintRule({
3139
- name: RULE_NAME$50,
3145
+ name: RULE_NAME$51,
3140
3146
  meta: {
3141
3147
  docs: {
3142
3148
  description: "disallow the use of certain matchers",
@@ -3178,9 +3184,9 @@ var no_restricted_matchers_default = createEslintRule({
3178
3184
 
3179
3185
  //#endregion
3180
3186
  //#region src/rules/no-restricted-vi-methods.ts
3181
- const RULE_NAME$49 = "no-restricted-vi-methods";
3187
+ const RULE_NAME$50 = "no-restricted-vi-methods";
3182
3188
  var no_restricted_vi_methods_default = createEslintRule({
3183
- name: RULE_NAME$49,
3189
+ name: RULE_NAME$50,
3184
3190
  meta: {
3185
3191
  type: "suggestion",
3186
3192
  docs: {
@@ -3222,7 +3228,7 @@ var no_restricted_vi_methods_default = createEslintRule({
3222
3228
 
3223
3229
  //#endregion
3224
3230
  //#region src/rules/no-standalone-expect.ts
3225
- const RULE_NAME$48 = "no-standalone-expect";
3231
+ const RULE_NAME$49 = "no-standalone-expect";
3226
3232
  const getBlockType = (statement, context) => {
3227
3233
  const func = statement.parent;
3228
3234
  if (!func) throw new Error("Unexpected block statement. If you feel like this is a bug report https://github.com/veritem/eslint-plugin-vitest/issues/new");
@@ -3235,7 +3241,7 @@ const getBlockType = (statement, context) => {
3235
3241
  return null;
3236
3242
  };
3237
3243
  var no_standalone_expect_default = createEslintRule({
3238
- name: RULE_NAME$48,
3244
+ name: RULE_NAME$49,
3239
3245
  meta: {
3240
3246
  docs: {
3241
3247
  description: "disallow using `expect` outside of `it` or `test` blocks",
@@ -3294,9 +3300,9 @@ var no_standalone_expect_default = createEslintRule({
3294
3300
 
3295
3301
  //#endregion
3296
3302
  //#region src/rules/no-test-prefixes.ts
3297
- const RULE_NAME$47 = "no-test-prefixes";
3303
+ const RULE_NAME$48 = "no-test-prefixes";
3298
3304
  var no_test_prefixes_default = createEslintRule({
3299
- name: RULE_NAME$47,
3305
+ name: RULE_NAME$48,
3300
3306
  meta: {
3301
3307
  docs: {
3302
3308
  description: "disallow using the `f` and `x` prefixes in favour of `.only` and `.skip`",
@@ -3331,14 +3337,14 @@ var no_test_prefixes_default = createEslintRule({
3331
3337
 
3332
3338
  //#endregion
3333
3339
  //#region src/rules/no-test-return-statement.ts
3334
- const RULE_NAME$46 = "no-test-return-statement";
3340
+ const RULE_NAME$47 = "no-test-return-statement";
3335
3341
  const getBody = (args) => {
3336
3342
  const [, secondArg] = args;
3337
3343
  if (secondArg && isFunction(secondArg) && secondArg.body.type === AST_NODE_TYPES.BlockStatement) return secondArg.body.body;
3338
3344
  return [];
3339
3345
  };
3340
3346
  var no_test_return_statement_default = createEslintRule({
3341
- name: RULE_NAME$46,
3347
+ name: RULE_NAME$47,
3342
3348
  meta: {
3343
3349
  type: "problem",
3344
3350
  docs: {
@@ -3538,7 +3544,7 @@ const testPadding = (prevNode, nextNode, paddingContext) => {
3538
3544
  };
3539
3545
  const verifyNode = (node, paddingContext) => {
3540
3546
  const { scopeInfo } = paddingContext;
3541
- if (!isValidParent(node?.parent.type)) return;
3547
+ if (node.parent && !isValidParent(node.parent.type)) return;
3542
3548
  if (scopeInfo.prevNode) testPadding(scopeInfo.prevNode, node, paddingContext);
3543
3549
  scopeInfo.prevNode = node;
3544
3550
  };
@@ -3609,7 +3615,7 @@ const createPaddingRule = (name, description, configs, deprecated = false) => {
3609
3615
 
3610
3616
  //#endregion
3611
3617
  //#region src/rules/padding-around-after-all-blocks.ts
3612
- const RULE_NAME$45 = "padding-around-after-all-blocks";
3618
+ const RULE_NAME$46 = "padding-around-after-all-blocks";
3613
3619
  const config = [{
3614
3620
  paddingType: PaddingType.Always,
3615
3621
  prevStatementType: StatementType.Any,
@@ -3619,11 +3625,11 @@ const config = [{
3619
3625
  prevStatementType: StatementType.AfterAllToken,
3620
3626
  nextStatementType: StatementType.Any
3621
3627
  }];
3622
- var padding_around_after_all_blocks_default = createPaddingRule(RULE_NAME$45, "Enforce padding around `afterAll` blocks", config);
3628
+ var padding_around_after_all_blocks_default = createPaddingRule(RULE_NAME$46, "Enforce padding around `afterAll` blocks", config);
3623
3629
 
3624
3630
  //#endregion
3625
3631
  //#region src/rules/padding-around-after-each-blocks.ts
3626
- const RULE_NAME$44 = "padding-around-after-each-blocks";
3632
+ const RULE_NAME$45 = "padding-around-after-each-blocks";
3627
3633
  const config$1 = [{
3628
3634
  paddingType: PaddingType.Always,
3629
3635
  prevStatementType: StatementType.Any,
@@ -3633,11 +3639,11 @@ const config$1 = [{
3633
3639
  prevStatementType: StatementType.AfterEachToken,
3634
3640
  nextStatementType: StatementType.Any
3635
3641
  }];
3636
- var padding_around_after_each_blocks_default = createPaddingRule(RULE_NAME$44, "Enforce padding around `afterEach` blocks", config$1);
3642
+ var padding_around_after_each_blocks_default = createPaddingRule(RULE_NAME$45, "Enforce padding around `afterEach` blocks", config$1);
3637
3643
 
3638
3644
  //#endregion
3639
3645
  //#region src/rules/padding-around-before-all-blocks.ts
3640
- const RULE_NAME$43 = "padding-around-before-all-blocks";
3646
+ const RULE_NAME$44 = "padding-around-before-all-blocks";
3641
3647
  const config$2 = [{
3642
3648
  paddingType: PaddingType.Always,
3643
3649
  prevStatementType: StatementType.Any,
@@ -3647,11 +3653,11 @@ const config$2 = [{
3647
3653
  prevStatementType: StatementType.BeforeAllToken,
3648
3654
  nextStatementType: StatementType.Any
3649
3655
  }];
3650
- var padding_around_before_all_blocks_default = createPaddingRule(RULE_NAME$43, "Enforce padding around `beforeAll` blocks", config$2);
3656
+ var padding_around_before_all_blocks_default = createPaddingRule(RULE_NAME$44, "Enforce padding around `beforeAll` blocks", config$2);
3651
3657
 
3652
3658
  //#endregion
3653
3659
  //#region src/rules/padding-around-before-each-blocks.ts
3654
- const RULE_NAME$42 = "padding-around-before-each-blocks";
3660
+ const RULE_NAME$43 = "padding-around-before-each-blocks";
3655
3661
  const config$3 = [{
3656
3662
  paddingType: PaddingType.Always,
3657
3663
  prevStatementType: StatementType.Any,
@@ -3661,11 +3667,11 @@ const config$3 = [{
3661
3667
  prevStatementType: StatementType.BeforeEachToken,
3662
3668
  nextStatementType: StatementType.Any
3663
3669
  }];
3664
- var padding_around_before_each_blocks_default = createPaddingRule(RULE_NAME$42, "Enforce padding around `beforeEach` blocks", config$3);
3670
+ var padding_around_before_each_blocks_default = createPaddingRule(RULE_NAME$43, "Enforce padding around `beforeEach` blocks", config$3);
3665
3671
 
3666
3672
  //#endregion
3667
3673
  //#region src/rules/padding-around-describe-blocks.ts
3668
- const RULE_NAME$41 = "padding-around-describe-blocks";
3674
+ const RULE_NAME$42 = "padding-around-describe-blocks";
3669
3675
  const config$4 = [{
3670
3676
  paddingType: PaddingType.Always,
3671
3677
  prevStatementType: StatementType.Any,
@@ -3683,11 +3689,11 @@ const config$4 = [{
3683
3689
  ],
3684
3690
  nextStatementType: StatementType.Any
3685
3691
  }];
3686
- var padding_around_describe_blocks_default = createPaddingRule(RULE_NAME$41, "Enforce padding around `describe` blocks", config$4);
3692
+ var padding_around_describe_blocks_default = createPaddingRule(RULE_NAME$42, "Enforce padding around `describe` blocks", config$4);
3687
3693
 
3688
3694
  //#endregion
3689
3695
  //#region src/rules/padding-around-expect-groups.ts
3690
- const RULE_NAME$40 = "padding-around-expect-groups";
3696
+ const RULE_NAME$41 = "padding-around-expect-groups";
3691
3697
  const config$5 = [
3692
3698
  {
3693
3699
  paddingType: PaddingType.Always,
@@ -3720,11 +3726,11 @@ const config$5 = [
3720
3726
  nextStatementType: StatementType.ExpectTypeOfToken
3721
3727
  }
3722
3728
  ];
3723
- var padding_around_expect_groups_default = createPaddingRule(RULE_NAME$40, "Enforce padding around `expect` groups", config$5);
3729
+ var padding_around_expect_groups_default = createPaddingRule(RULE_NAME$41, "Enforce padding around `expect` groups", config$5);
3724
3730
 
3725
3731
  //#endregion
3726
3732
  //#region src/rules/padding-around-test-blocks.ts
3727
- const RULE_NAME$39 = "padding-around-test-blocks";
3733
+ const RULE_NAME$40 = "padding-around-test-blocks";
3728
3734
  const config$6 = [{
3729
3735
  paddingType: PaddingType.Always,
3730
3736
  prevStatementType: StatementType.Any,
@@ -3746,12 +3752,12 @@ const config$6 = [{
3746
3752
  ],
3747
3753
  nextStatementType: StatementType.Any
3748
3754
  }];
3749
- var padding_around_test_blocks_default = createPaddingRule(RULE_NAME$39, "Enforce padding around `test` blocks", config$6);
3755
+ var padding_around_test_blocks_default = createPaddingRule(RULE_NAME$40, "Enforce padding around `test` blocks", config$6);
3750
3756
 
3751
3757
  //#endregion
3752
3758
  //#region src/rules/padding-around-all.ts
3753
- const RULE_NAME$38 = "padding-around-all";
3754
- var padding_around_all_default = createPaddingRule(RULE_NAME$38, "Enforce padding around vitest functions", [
3759
+ const RULE_NAME$39 = "padding-around-all";
3760
+ var padding_around_all_default = createPaddingRule(RULE_NAME$39, "Enforce padding around vitest functions", [
3755
3761
  ...config,
3756
3762
  ...config$1,
3757
3763
  ...config$2,
@@ -3763,7 +3769,7 @@ var padding_around_all_default = createPaddingRule(RULE_NAME$38, "Enforce paddin
3763
3769
 
3764
3770
  //#endregion
3765
3771
  //#region src/rules/prefer-called-exactly-once-with.ts
3766
- const RULE_NAME$37 = "prefer-called-exactly-once-with";
3772
+ const RULE_NAME$38 = "prefer-called-exactly-once-with";
3767
3773
  const MATCHERS_TO_COMBINE = ["toHaveBeenCalledOnce", "toHaveBeenCalledWith"];
3768
3774
  const MOCK_CALL_RESET_METHODS = [
3769
3775
  "mockClear",
@@ -3822,7 +3828,7 @@ const hasMockResetBetween = (body, firstCallExpression, secondCallExpression) =>
3822
3828
  };
3823
3829
  const getMemberProperty = (expression) => expression.callee.type === AST_NODE_TYPES.MemberExpression ? expression.callee.property : null;
3824
3830
  var prefer_called_exactly_once_with_default = createEslintRule({
3825
- name: RULE_NAME$37,
3831
+ name: RULE_NAME$38,
3826
3832
  meta: {
3827
3833
  docs: { description: "Prefer `toHaveBeenCalledExactlyOnceWith` over `toHaveBeenCalledOnce` and `toHaveBeenCalledWith`" },
3828
3834
  messages: { preferCalledExactlyOnceWith: "Using `toHaveBeenCalledOnce` and `toHaveBeenCalledWith` on the same target; prefer `toHaveBeenCalledExactlyOnceWith` instead." },
@@ -3863,7 +3869,7 @@ var prefer_called_exactly_once_with_default = createEslintRule({
3863
3869
  messageId: "preferCalledExactlyOnceWith",
3864
3870
  node: targetNode,
3865
3871
  fix(fixer) {
3866
- const replacement = `${sourceCode.text.slice(firstCallExpression.parent.range[0], firstCallExpression.range[0])}${expectedText}.toHaveBeenCalledExactlyOnceWith(${argsText})`;
3872
+ const replacement = `${sourceCode.text.slice(firstCallExpression.parent.range[0], firstCallExpression.range[0])}${expectedText}.toHaveBeenCalledExactlyOnceWith${targetArgNode.callExpression.typeArguments ? sourceCode.text.slice(targetArgNode.callExpression.typeArguments.range[0], targetArgNode.callExpression.typeArguments.range[1]) : ""}(${argsText})`;
3867
3873
  const lineStart = sourceCode.getIndexFromLoc({
3868
3874
  line: secondCallExpression.parent.loc.start.line,
3869
3875
  column: 0
@@ -3890,10 +3896,10 @@ var prefer_called_exactly_once_with_default = createEslintRule({
3890
3896
 
3891
3897
  //#endregion
3892
3898
  //#region src/rules/prefer-called-once.ts
3893
- const RULE_NAME$36 = "prefer-called-once";
3899
+ const RULE_NAME$37 = "prefer-called-once";
3894
3900
  const isOneLiteral = (node) => node.type === AST_NODE_TYPES.Literal && node.value === 1;
3895
3901
  var prefer_called_once_default = createEslintRule({
3896
- name: RULE_NAME$36,
3902
+ name: RULE_NAME$37,
3897
3903
  meta: {
3898
3904
  docs: {
3899
3905
  description: "enforce using `toBeCalledOnce()` or `toHaveBeenCalledOnce()`",
@@ -3926,9 +3932,9 @@ var prefer_called_once_default = createEslintRule({
3926
3932
 
3927
3933
  //#endregion
3928
3934
  //#region src/rules/prefer-called-times.ts
3929
- const RULE_NAME$35 = "prefer-called-times";
3935
+ const RULE_NAME$36 = "prefer-called-times";
3930
3936
  var prefer_called_times_default = createEslintRule({
3931
- name: RULE_NAME$35,
3937
+ name: RULE_NAME$36,
3932
3938
  meta: {
3933
3939
  docs: {
3934
3940
  description: "enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)`",
@@ -3961,9 +3967,9 @@ var prefer_called_times_default = createEslintRule({
3961
3967
 
3962
3968
  //#endregion
3963
3969
  //#region src/rules/prefer-called-with.ts
3964
- const RULE_NAME$34 = "prefer-called-with";
3970
+ const RULE_NAME$35 = "prefer-called-with";
3965
3971
  var prefer_called_with_default = createEslintRule({
3966
- name: RULE_NAME$34,
3972
+ name: RULE_NAME$35,
3967
3973
  meta: {
3968
3974
  docs: {
3969
3975
  description: "enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()`",
@@ -4011,7 +4017,7 @@ const hasOnlyOneArgument = (call) => call.arguments.length === 1;
4011
4017
 
4012
4018
  //#endregion
4013
4019
  //#region src/rules/prefer-comparison-matcher.ts
4014
- const RULE_NAME$33 = "prefer-comparison-matcher";
4020
+ const RULE_NAME$34 = "prefer-comparison-matcher";
4015
4021
  const isString = (node) => {
4016
4022
  return isStringNode(node) || node?.type === AST_NODE_TYPES.TemplateLiteral;
4017
4023
  };
@@ -4037,7 +4043,7 @@ const determineMatcher = (operator, negated) => {
4037
4043
  return null;
4038
4044
  };
4039
4045
  var prefer_comparison_matcher_default = createEslintRule({
4040
- name: RULE_NAME$33,
4046
+ name: RULE_NAME$34,
4041
4047
  meta: {
4042
4048
  type: "suggestion",
4043
4049
  docs: {
@@ -4083,9 +4089,9 @@ var prefer_comparison_matcher_default = createEslintRule({
4083
4089
 
4084
4090
  //#endregion
4085
4091
  //#region src/rules/prefer-describe-function-title.ts
4086
- const RULE_NAME$32 = "prefer-describe-function-title";
4092
+ const RULE_NAME$33 = "prefer-describe-function-title";
4087
4093
  var prefer_describe_function_title_default = createEslintRule({
4088
- name: RULE_NAME$32,
4094
+ name: RULE_NAME$33,
4089
4095
  meta: {
4090
4096
  type: "problem",
4091
4097
  docs: {
@@ -4135,9 +4141,9 @@ var prefer_describe_function_title_default = createEslintRule({
4135
4141
 
4136
4142
  //#endregion
4137
4143
  //#region src/rules/prefer-each.ts
4138
- const RULE_NAME$31 = "prefer-each";
4144
+ const RULE_NAME$32 = "prefer-each";
4139
4145
  var prefer_each_default = createEslintRule({
4140
- name: RULE_NAME$31,
4146
+ name: RULE_NAME$32,
4141
4147
  meta: {
4142
4148
  type: "suggestion",
4143
4149
  docs: {
@@ -4190,9 +4196,9 @@ var prefer_each_default = createEslintRule({
4190
4196
 
4191
4197
  //#endregion
4192
4198
  //#region src/rules/prefer-equality-matcher.ts
4193
- const RULE_NAME$30 = "prefer-equality-matcher";
4199
+ const RULE_NAME$31 = "prefer-equality-matcher";
4194
4200
  var prefer_equality_matcher_default = createEslintRule({
4195
- name: RULE_NAME$30,
4201
+ name: RULE_NAME$31,
4196
4202
  meta: {
4197
4203
  type: "suggestion",
4198
4204
  docs: {
@@ -4410,9 +4416,9 @@ var prefer_expect_assertions_default = createEslintRule({
4410
4416
 
4411
4417
  //#endregion
4412
4418
  //#region src/rules/prefer-expect-resolves.ts
4413
- const RULE_NAME$29 = "prefer-expect-resolves";
4419
+ const RULE_NAME$30 = "prefer-expect-resolves";
4414
4420
  var prefer_expect_resolves_default = createEslintRule({
4415
- name: RULE_NAME$29,
4421
+ name: RULE_NAME$30,
4416
4422
  meta: {
4417
4423
  type: "suggestion",
4418
4424
  docs: {
@@ -4446,7 +4452,7 @@ var prefer_expect_resolves_default = createEslintRule({
4446
4452
 
4447
4453
  //#endregion
4448
4454
  //#region src/rules/prefer-expect-type-of.ts
4449
- const RULE_NAME$28 = "prefer-expect-type-of";
4455
+ const RULE_NAME$29 = "prefer-expect-type-of";
4450
4456
  const typeMatchers = {
4451
4457
  string: "toBeString",
4452
4458
  number: "toBeNumber",
@@ -4458,7 +4464,7 @@ const typeMatchers = {
4458
4464
  undefined: "toBeUndefined"
4459
4465
  };
4460
4466
  var prefer_expect_type_of_default = createEslintRule({
4461
- name: RULE_NAME$28,
4467
+ name: RULE_NAME$29,
4462
4468
  meta: {
4463
4469
  type: "suggestion",
4464
4470
  docs: {
@@ -4507,7 +4513,7 @@ var prefer_expect_type_of_default = createEslintRule({
4507
4513
 
4508
4514
  //#endregion
4509
4515
  //#region src/rules/prefer-hooks-in-order.ts
4510
- const RULE_NAME$27 = "prefer-hooks-in-order";
4516
+ const RULE_NAME$28 = "prefer-hooks-in-order";
4511
4517
  const HooksOrder = [
4512
4518
  "beforeAll",
4513
4519
  "beforeEach",
@@ -4515,7 +4521,7 @@ const HooksOrder = [
4515
4521
  "afterAll"
4516
4522
  ];
4517
4523
  var prefer_hooks_in_order_default = createEslintRule({
4518
- name: RULE_NAME$27,
4524
+ name: RULE_NAME$28,
4519
4525
  meta: {
4520
4526
  type: "suggestion",
4521
4527
  docs: {
@@ -4568,9 +4574,9 @@ var prefer_hooks_in_order_default = createEslintRule({
4568
4574
 
4569
4575
  //#endregion
4570
4576
  //#region src/rules/prefer-hooks-on-top.ts
4571
- const RULE_NAME$26 = "prefer-hooks-on-top";
4577
+ const RULE_NAME$27 = "prefer-hooks-on-top";
4572
4578
  var prefer_hooks_on_top_default = createEslintRule({
4573
- name: RULE_NAME$26,
4579
+ name: RULE_NAME$27,
4574
4580
  meta: {
4575
4581
  type: "suggestion",
4576
4582
  docs: {
@@ -4601,9 +4607,9 @@ var prefer_hooks_on_top_default = createEslintRule({
4601
4607
 
4602
4608
  //#endregion
4603
4609
  //#region src/rules/prefer-import-in-mock.ts
4604
- const RULE_NAME$25 = "prefer-import-in-mock";
4610
+ const RULE_NAME$26 = "prefer-import-in-mock";
4605
4611
  var prefer_import_in_mock_default = createEslintRule({
4606
- name: RULE_NAME$25,
4612
+ name: RULE_NAME$26,
4607
4613
  meta: {
4608
4614
  fixable: "code",
4609
4615
  type: "suggestion",
@@ -4633,9 +4639,9 @@ var prefer_import_in_mock_default = createEslintRule({
4633
4639
 
4634
4640
  //#endregion
4635
4641
  //#region src/rules/prefer-importing-vitest-globals.ts
4636
- const RULE_NAME$24 = "prefer-importing-vitest-globals";
4642
+ const RULE_NAME$25 = "prefer-importing-vitest-globals";
4637
4643
  var prefer_importing_vitest_globals_default = createEslintRule({
4638
- name: RULE_NAME$24,
4644
+ name: RULE_NAME$25,
4639
4645
  meta: {
4640
4646
  type: "suggestion",
4641
4647
  docs: {
@@ -4708,7 +4714,7 @@ var prefer_importing_vitest_globals_default = createEslintRule({
4708
4714
 
4709
4715
  //#endregion
4710
4716
  //#region src/rules/prefer-lowercase-title.ts
4711
- const RULE_NAME$23 = "prefer-lowercase-title";
4717
+ const RULE_NAME$24 = "prefer-lowercase-title";
4712
4718
  const hasStringAsFirstArgument = (node) => node.arguments[0] && isStringNode(node.arguments[0]);
4713
4719
  const populateIgnores = (ignore) => {
4714
4720
  const ignores = [];
@@ -4718,7 +4724,7 @@ const populateIgnores = (ignore) => {
4718
4724
  return ignores;
4719
4725
  };
4720
4726
  var prefer_lowercase_title_default = createEslintRule({
4721
- name: RULE_NAME$23,
4727
+ name: RULE_NAME$24,
4722
4728
  meta: {
4723
4729
  type: "problem",
4724
4730
  docs: {
@@ -4773,7 +4779,7 @@ var prefer_lowercase_title_default = createEslintRule({
4773
4779
  return {
4774
4780
  CallExpression(node) {
4775
4781
  const vitestFnCall = parseVitestFnCall(node, context);
4776
- if (!vitestFnCall || !hasStringAsFirstArgument) return;
4782
+ if (!vitestFnCall || !hasStringAsFirstArgument(node)) return;
4777
4783
  if (vitestFnCall?.type === "describe") {
4778
4784
  numberOfDescribeBlocks++;
4779
4785
  if (ignoreTopLevelDescribe && numberOfDescribeBlocks === 1) return;
@@ -4805,7 +4811,7 @@ var prefer_lowercase_title_default = createEslintRule({
4805
4811
 
4806
4812
  //#endregion
4807
4813
  //#region src/rules/prefer-mock-promise-shorthand.ts
4808
- const RULE_NAME$22 = "prefer-mock-promise-shorthand";
4814
+ const RULE_NAME$23 = "prefer-mock-promise-shorthand";
4809
4815
  const withOnce = (name, addOnce) => {
4810
4816
  return `${name}${addOnce ? "Once" : ""}`;
4811
4817
  };
@@ -4815,7 +4821,7 @@ const findSingleReturnArgumentNode = (fnNode) => {
4815
4821
  return null;
4816
4822
  };
4817
4823
  var prefer_mock_promise_shorthand_default = createEslintRule({
4818
- name: RULE_NAME$22,
4824
+ name: RULE_NAME$23,
4819
4825
  meta: {
4820
4826
  type: "suggestion",
4821
4827
  docs: {
@@ -4860,7 +4866,7 @@ var prefer_mock_promise_shorthand_default = createEslintRule({
4860
4866
 
4861
4867
  //#endregion
4862
4868
  //#region src/rules/prefer-snapshot-hint.ts
4863
- const RULE_NAME$21 = "prefer-snapshot-hint";
4869
+ const RULE_NAME$22 = "prefer-snapshot-hint";
4864
4870
  const snapshotMatcherNames = ["toMatchSnapshot", "toThrowErrorMatchingSnapshot"];
4865
4871
  const isSnapshotMatcherWithoutHint = (expectFnCall) => {
4866
4872
  if (expectFnCall.args.length === 0) return true;
@@ -4870,7 +4876,7 @@ const isSnapshotMatcherWithoutHint = (expectFnCall) => {
4870
4876
  return !isStringNode(arg);
4871
4877
  };
4872
4878
  var prefer_snapshot_hint_default = createEslintRule({
4873
- name: RULE_NAME$21,
4879
+ name: RULE_NAME$22,
4874
4880
  meta: {
4875
4881
  type: "suggestion",
4876
4882
  docs: {
@@ -4939,7 +4945,7 @@ var prefer_snapshot_hint_default = createEslintRule({
4939
4945
 
4940
4946
  //#endregion
4941
4947
  //#region src/rules/prefer-spy-on.ts
4942
- const RULE_NAME$20 = "prefer-spy-on";
4948
+ const RULE_NAME$21 = "prefer-spy-on";
4943
4949
  const findNodeObject = (node) => {
4944
4950
  if ("object" in node) return node.object;
4945
4951
  if (node.callee.type === AST_NODE_TYPES.MemberExpression) return node.callee.object;
@@ -4959,7 +4965,7 @@ const getAutoFixMockImplementation = (vitestFnCall, context) => {
4959
4965
  return argSource ? `.mockImplementation(${argSource})` : ".mockImplementation()";
4960
4966
  };
4961
4967
  var prefer_spy_on_default = createEslintRule({
4962
- name: RULE_NAME$20,
4968
+ name: RULE_NAME$21,
4963
4969
  meta: {
4964
4970
  type: "suggestion",
4965
4971
  docs: {
@@ -4996,9 +5002,9 @@ var prefer_spy_on_default = createEslintRule({
4996
5002
 
4997
5003
  //#endregion
4998
5004
  //#region src/rules/prefer-strict-boolean-matchers.ts
4999
- const RULE_NAME$19 = "prefer-strict-boolean-matchers";
5005
+ const RULE_NAME$20 = "prefer-strict-boolean-matchers";
5000
5006
  var prefer_strict_boolean_matchers_default = createEslintRule({
5001
- name: RULE_NAME$19,
5007
+ name: RULE_NAME$20,
5002
5008
  meta: {
5003
5009
  type: "suggestion",
5004
5010
  docs: {
@@ -5034,9 +5040,9 @@ var prefer_strict_boolean_matchers_default = createEslintRule({
5034
5040
 
5035
5041
  //#endregion
5036
5042
  //#region src/rules/prefer-strict-equal.ts
5037
- const RULE_NAME$18 = "prefer-strict-equal";
5043
+ const RULE_NAME$19 = "prefer-strict-equal";
5038
5044
  var prefer_strict_equal_default = createEslintRule({
5039
- name: RULE_NAME$18,
5045
+ name: RULE_NAME$19,
5040
5046
  meta: {
5041
5047
  type: "suggestion",
5042
5048
  docs: {
@@ -5070,10 +5076,10 @@ var prefer_strict_equal_default = createEslintRule({
5070
5076
 
5071
5077
  //#endregion
5072
5078
  //#region src/rules/prefer-to-be-falsy.ts
5073
- const RULE_NAME$17 = "prefer-to-be-falsy";
5079
+ const RULE_NAME$18 = "prefer-to-be-falsy";
5074
5080
  const isFalseLiteral = (node) => node.type === AST_NODE_TYPES.Literal && node.value === false;
5075
5081
  var prefer_to_be_falsy_default = createEslintRule({
5076
- name: RULE_NAME$17,
5082
+ name: RULE_NAME$18,
5077
5083
  meta: {
5078
5084
  type: "suggestion",
5079
5085
  docs: {
@@ -5100,9 +5106,9 @@ var prefer_to_be_falsy_default = createEslintRule({
5100
5106
 
5101
5107
  //#endregion
5102
5108
  //#region src/rules/prefer-to-be-object.ts
5103
- const RULE_NAME$16 = "prefer-to-be-object";
5109
+ const RULE_NAME$17 = "prefer-to-be-object";
5104
5110
  var prefer_to_be_object_default = createEslintRule({
5105
- name: RULE_NAME$16,
5111
+ name: RULE_NAME$17,
5106
5112
  meta: {
5107
5113
  type: "suggestion",
5108
5114
  docs: {
@@ -5154,10 +5160,10 @@ var prefer_to_be_object_default = createEslintRule({
5154
5160
 
5155
5161
  //#endregion
5156
5162
  //#region src/rules/prefer-to-be-truthy.ts
5157
- const RULE_NAME$15 = "prefer-to-be-truthy";
5163
+ const RULE_NAME$16 = "prefer-to-be-truthy";
5158
5164
  const isTrueLiteral = (node) => node.type === AST_NODE_TYPES.Literal && node.value === true;
5159
5165
  var prefer_to_be_truthy_default = createEslintRule({
5160
- name: RULE_NAME$15,
5166
+ name: RULE_NAME$16,
5161
5167
  meta: {
5162
5168
  type: "suggestion",
5163
5169
  docs: {
@@ -5184,7 +5190,7 @@ var prefer_to_be_truthy_default = createEslintRule({
5184
5190
 
5185
5191
  //#endregion
5186
5192
  //#region src/rules/prefer-to-be.ts
5187
- const RULE_NAME$14 = "prefer-to-be";
5193
+ const RULE_NAME$15 = "prefer-to-be";
5188
5194
  const isNullLiteral = (node) => node.type === AST_NODE_TYPES.Literal && node.value === null;
5189
5195
  const isNullEqualityMatcher = (expectFnCall) => isNullLiteral(getFirstMatcherArg(expectFnCall));
5190
5196
  const isFirstArgumentIdentifier = (expectFnCall, name) => isIdentifier(getFirstMatcherArg(expectFnCall), name);
@@ -5209,7 +5215,7 @@ const reportPreferToBe = (context, whatToBe, expectFnCall, func, modifierNode) =
5209
5215
  });
5210
5216
  };
5211
5217
  var prefer_to_be_default = createEslintRule({
5212
- name: RULE_NAME$14,
5218
+ name: RULE_NAME$15,
5213
5219
  meta: {
5214
5220
  type: "suggestion",
5215
5221
  docs: {
@@ -5257,10 +5263,10 @@ var prefer_to_be_default = createEslintRule({
5257
5263
 
5258
5264
  //#endregion
5259
5265
  //#region src/rules/prefer-to-contain.ts
5260
- const RULE_NAME$13 = "prefer-to-contain";
5266
+ const RULE_NAME$14 = "prefer-to-contain";
5261
5267
  const isFixableIncludesCallExpression = (node) => node.type === AST_NODE_TYPES.CallExpression && node.callee.type === AST_NODE_TYPES.MemberExpression && isSupportedAccessor(node.callee.property, "includes") && hasOnlyOneArgument(node) && node.arguments[0].type !== AST_NODE_TYPES.SpreadElement;
5262
5268
  var prefer_to_contain_default = createEslintRule({
5263
- name: RULE_NAME$13,
5269
+ name: RULE_NAME$14,
5264
5270
  meta: {
5265
5271
  docs: {
5266
5272
  description: "enforce using toContain()",
@@ -5302,9 +5308,9 @@ var prefer_to_contain_default = createEslintRule({
5302
5308
 
5303
5309
  //#endregion
5304
5310
  //#region src/rules/prefer-to-have-length.ts
5305
- const RULE_NAME$12 = "prefer-to-have-length";
5311
+ const RULE_NAME$13 = "prefer-to-have-length";
5306
5312
  var prefer_to_have_length_default = createEslintRule({
5307
- name: RULE_NAME$12,
5313
+ name: RULE_NAME$13,
5308
5314
  meta: {
5309
5315
  type: "suggestion",
5310
5316
  docs: {
@@ -5338,7 +5344,7 @@ var prefer_to_have_length_default = createEslintRule({
5338
5344
 
5339
5345
  //#endregion
5340
5346
  //#region src/rules/prefer-todo.ts
5341
- const RULE_NAME$11 = "prefer-todo";
5347
+ const RULE_NAME$12 = "prefer-todo";
5342
5348
  const isTargetedTestCase = (vitestFnCall) => {
5343
5349
  if (vitestFnCall.members.some((s) => getAccessorValue(s) !== "skip")) return false;
5344
5350
  if (vitestFnCall.name.startsWith("x")) return false;
@@ -5353,7 +5359,7 @@ function createTodoFixer(vitestFnCall, fixer) {
5353
5359
  return fixer.replaceText(vitestFnCall.head.node, `${vitestFnCall.head.local}.todo`);
5354
5360
  }
5355
5361
  var prefer_todo_default = createEslintRule({
5356
- name: RULE_NAME$11,
5362
+ name: RULE_NAME$12,
5357
5363
  meta: {
5358
5364
  type: "layout",
5359
5365
  docs: {
@@ -5389,7 +5395,7 @@ var prefer_todo_default = createEslintRule({
5389
5395
 
5390
5396
  //#endregion
5391
5397
  //#region src/rules/prefer-vi-mocked.ts
5392
- const RULE_NAME$10 = "prefer-vi-mocked";
5398
+ const RULE_NAME$11 = "prefer-vi-mocked";
5393
5399
  const mockTypes = [
5394
5400
  "Mock",
5395
5401
  "MockedFunction",
@@ -5397,7 +5403,7 @@ const mockTypes = [
5397
5403
  "MockedObject"
5398
5404
  ];
5399
5405
  var prefer_vi_mocked_default = createEslintRule({
5400
- name: RULE_NAME$10,
5406
+ name: RULE_NAME$11,
5401
5407
  meta: {
5402
5408
  type: "suggestion",
5403
5409
  docs: {
@@ -5438,6 +5444,55 @@ var prefer_vi_mocked_default = createEslintRule({
5438
5444
  }
5439
5445
  });
5440
5446
 
5447
+ //#endregion
5448
+ //#region src/rules/require-awaited-expect-poll.ts
5449
+ const RULE_NAME$10 = "require-awaited-expect-poll";
5450
+ var require_awaited_expect_poll_default = createEslintRule({
5451
+ name: RULE_NAME$10,
5452
+ meta: {
5453
+ docs: {
5454
+ requiresTypeChecking: false,
5455
+ recommended: false,
5456
+ description: "ensure that every `expect.poll` call is awaited"
5457
+ },
5458
+ messages: { notAwaited: "`{{ method }}` calls should be awaited" },
5459
+ type: "problem",
5460
+ schema: []
5461
+ },
5462
+ defaultOptions: [],
5463
+ create(context) {
5464
+ const reported = /* @__PURE__ */ new Set();
5465
+ return { CallExpression(node) {
5466
+ const vitestFnCall = parseVitestFnCall(node, context);
5467
+ if (vitestFnCall?.type !== "expect" || !vitestFnCall.members.length || !memberRequiresAwait(vitestFnCall.members[0])) return;
5468
+ const nodeToReport = vitestFnCall.members[0].parent;
5469
+ if (reported.has(nodeToReport)) return;
5470
+ const topMostNode = skipSequenceExpressions(skipMatchersAndModifiers(vitestFnCall.head.node));
5471
+ if (topMostNode.parent?.type === AST_NODE_TYPES.AwaitExpression || topMostNode.parent?.type === AST_NODE_TYPES.ReturnStatement) return;
5472
+ context.report({
5473
+ node: nodeToReport,
5474
+ messageId: "notAwaited",
5475
+ data: { method: `expect.${getAccessorValue(vitestFnCall.members[0])}` }
5476
+ });
5477
+ reported.add(nodeToReport);
5478
+ } };
5479
+ }
5480
+ });
5481
+ const awaitedMembers = ["poll", "element"];
5482
+ function memberRequiresAwait(member) {
5483
+ return awaitedMembers.includes(getAccessorValue(member));
5484
+ }
5485
+ function skipMatchersAndModifiers(node) {
5486
+ let currentNode = node;
5487
+ while (currentNode.parent.type === AST_NODE_TYPES.MemberExpression || currentNode.parent.type === AST_NODE_TYPES.CallExpression) currentNode = currentNode.parent;
5488
+ return currentNode;
5489
+ }
5490
+ function skipSequenceExpressions(node) {
5491
+ let currentNode = node;
5492
+ while (currentNode.parent?.type === AST_NODE_TYPES.SequenceExpression && currentNode.parent.expressions.at(-1) === currentNode) currentNode = currentNode.parent;
5493
+ return currentNode;
5494
+ }
5495
+
5441
5496
  //#endregion
5442
5497
  //#region src/rules/require-hook.ts
5443
5498
  const RULE_NAME$9 = "require-hook";
@@ -5519,13 +5574,15 @@ var require_local_test_context_for_concurrent_snapshots_default = createEslintRu
5519
5574
  if (vitestFnCall === null) return;
5520
5575
  if (vitestFnCall.type !== "expect") return;
5521
5576
  if (vitestFnCall.type === "expect" && vitestFnCall.head.type === "testContext") return;
5577
+ if (node.callee.type !== AST_NODE_TYPES.MemberExpression) return;
5578
+ if (node.callee.property.type !== AST_NODE_TYPES.Identifier) return;
5522
5579
  if (![
5523
5580
  "toMatchSnapshot",
5524
5581
  "toMatchInlineSnapshot",
5525
5582
  "toMatchFileSnapshot",
5526
5583
  "toThrowErrorMatchingSnapshot",
5527
5584
  "toThrowErrorMatchingInlineSnapshot"
5528
- ].includes(node.callee?.property.name)) return;
5585
+ ].includes(node.callee.property.name)) return;
5529
5586
  if (!context.sourceCode.getAncestors(node).some((ancestor) => {
5530
5587
  if (ancestor.type !== AST_NODE_TYPES.CallExpression) return false;
5531
5588
  if (!isTypeOfVitestFnCall(ancestor, context, ["describe", "test"])) return false;
@@ -5563,7 +5620,7 @@ var require_mock_type_parameters_default = createEslintRule({
5563
5620
  return { CallExpression(node) {
5564
5621
  const vitestFnCall = parseVitestFnCall(node, context);
5565
5622
  if (vitestFnCall?.type !== "vi") return;
5566
- for (const member of vitestFnCall?.members) {
5623
+ for (const member of vitestFnCall.members) {
5567
5624
  if (!("name" in member) || member.parent.parent.typeArguments !== void 0) continue;
5568
5625
  if (member.name === "fn") context.report({
5569
5626
  node: member,
@@ -6477,6 +6534,7 @@ const rules = {
6477
6534
  "prefer-to-have-length": prefer_to_have_length_default,
6478
6535
  "prefer-todo": prefer_todo_default,
6479
6536
  "prefer-vi-mocked": prefer_vi_mocked_default,
6537
+ "require-awaited-expect-poll": require_awaited_expect_poll_default,
6480
6538
  "require-hook": require_hook_default,
6481
6539
  "require-local-test-context-for-concurrent-snapshots": require_local_test_context_for_concurrent_snapshots_default,
6482
6540
  "require-mock-type-parameters": require_mock_type_parameters_default,
@@ -6579,7 +6637,8 @@ const allRules = {
6579
6637
  "valid-describe-callback": "warn",
6580
6638
  "valid-expect-in-promise": "warn",
6581
6639
  "valid-expect": "warn",
6582
- "valid-title": "warn"
6640
+ "valid-title": "warn",
6641
+ "require-awaited-expect-poll": "warn"
6583
6642
  };
6584
6643
  const recommendedRules = {
6585
6644
  "expect-expect": "error",