create()

in src/rule-hook-required-argument.js [27:64]


  create(context) {
    if (!shouldLint(context)) {
      return {};
    }

    return {
      'CallExpression[callee.name=useFragment][arguments.length < 2]'(node) {
        reportMissingKeyArgument(node, context, 'useFragment');
      },
      'CallExpression[callee.name=usePaginationFragment][arguments.length < 2]'(
        node
      ) {
        reportMissingKeyArgument(node, context, 'usePaginationFragment');
      },

      'CallExpression[callee.name=useBlockingPaginationFragment][arguments.length < 2]'(
        node
      ) {
        reportMissingKeyArgument(
          node,
          context,
          'useBlockingPaginationFragment'
        );
      },

      'CallExpression[callee.name=useLegacyPaginationFragment][arguments.length < 2]'(
        node
      ) {
        reportMissingKeyArgument(node, context, 'useLegacyPaginationFragment');
      },

      'CallExpression[callee.name=useRefetchableFragment][arguments.length < 2]'(
        node
      ) {
        reportMissingKeyArgument(node, context, 'useRefetchableFragment');
      }
    };
  }