@graphql-eslint/eslint-plugin 3.14.4-alpha-20230110215528-a1c4235 → 3.14.4-alpha-20230111223410-a558ee8

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.
@@ -78,8 +78,8 @@ exports.rule = {
78
78
  fieldNode = fieldNode.parent;
79
79
  }
80
80
  const args = Object.fromEntries(((_a = fieldNode.arguments) === null || _a === void 0 ? void 0 : _a.map(argument => [argument.name.value, argument])) || []);
81
- const hasForwardPagination = Boolean(args.first && args.after);
82
- const hasBackwardPagination = Boolean(args.last && args.before);
81
+ const hasForwardPagination = !!(args.first && args.after);
82
+ const hasBackwardPagination = !!(args.last && args.before);
83
83
  if (!hasForwardPagination && !hasBackwardPagination) {
84
84
  context.report({
85
85
  node: fieldNode.name,
@@ -89,7 +89,7 @@ exports.rule = {
89
89
  }
90
90
  function checkField(typeName, argumentName) {
91
91
  const argument = args[argumentName];
92
- const hasArgument = Boolean(argument);
92
+ const hasArgument = !!argument;
93
93
  let type = argument;
94
94
  if (hasArgument && type.gqlType.kind === graphql_1.Kind.NON_NULL_TYPE) {
95
95
  type = type.gqlType;
package/cjs/utils.js CHANGED
@@ -97,6 +97,6 @@ exports.ARRAY_DEFAULT_OPTIONS = {
97
97
  const englishJoinWords = (words) => new Intl.ListFormat('en-US', { type: 'disjunction' }).format(words);
98
98
  exports.englishJoinWords = englishJoinWords;
99
99
  function truthy(value) {
100
- return Boolean(value);
100
+ return !!value;
101
101
  }
102
102
  exports.truthy = truthy;
@@ -75,8 +75,8 @@ export const rule = {
75
75
  fieldNode = fieldNode.parent;
76
76
  }
77
77
  const args = Object.fromEntries(((_a = fieldNode.arguments) === null || _a === void 0 ? void 0 : _a.map(argument => [argument.name.value, argument])) || []);
78
- const hasForwardPagination = Boolean(args.first && args.after);
79
- const hasBackwardPagination = Boolean(args.last && args.before);
78
+ const hasForwardPagination = !!(args.first && args.after);
79
+ const hasBackwardPagination = !!(args.last && args.before);
80
80
  if (!hasForwardPagination && !hasBackwardPagination) {
81
81
  context.report({
82
82
  node: fieldNode.name,
@@ -86,7 +86,7 @@ export const rule = {
86
86
  }
87
87
  function checkField(typeName, argumentName) {
88
88
  const argument = args[argumentName];
89
- const hasArgument = Boolean(argument);
89
+ const hasArgument = !!argument;
90
90
  let type = argument;
91
91
  if (hasArgument && type.gqlType.kind === Kind.NON_NULL_TYPE) {
92
92
  type = type.gqlType;
package/esm/utils.js CHANGED
@@ -84,5 +84,5 @@ export const ARRAY_DEFAULT_OPTIONS = {
84
84
  };
85
85
  export const englishJoinWords = (words) => new Intl.ListFormat('en-US', { type: 'disjunction' }).format(words);
86
86
  export function truthy(value) {
87
- return Boolean(value);
87
+ return !!value;
88
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-eslint/eslint-plugin",
3
- "version": "3.14.4-alpha-20230110215528-a1c4235",
3
+ "version": "3.14.4-alpha-20230111223410-a558ee8",
4
4
  "description": "GraphQL plugin for ESLint",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {