Lint all the things

This commit is contained in:
Dave
2025-08-19 16:23:29 -04:00
parent f6d6b548be
commit 33fb60ca1a
640 changed files with 2129 additions and 3927 deletions

View File

@@ -2,8 +2,6 @@ import { gql } from "@apollo/client";
import { Kind, parse, print, visit } from "graphql";
import client from "./GraphQLClient";
/* eslint-disable no-loop-func */
/**
* The available operators for filtering (string)
* @type {[{label: string, value: string},{label: string, value: string},{label: string, value: string},{label: string, value: string},{label: string, value: string},null,null,null]}
@@ -117,7 +115,12 @@ export function printQuery(query) {
* @param shopSpecificTemplate
* @returns {Promise<{contextData: {}, useShopSpecificTemplate, shopSpecificTemplate}>}
*/
export async function generateTemplate(templateQueryToExecute, templateObject, useShopSpecificTemplate, shopSpecificFolder) {
export async function generateTemplate(
templateQueryToExecute,
templateObject,
useShopSpecificTemplate,
shopSpecificFolder
) {
// Advanced Filtering and Sorting modifications start here
// Parse the query and apply the filters and sorters
@@ -242,7 +245,7 @@ function applyTopLevelSub(node, fieldPath, filterField) {
if (fieldPath.length > 2) {
// More than one level deep
let currentField = whereArg.value;
fieldPath.slice(1, -1).forEach((path, index) => {
fieldPath.slice(1, -1).forEach((path) => {
let existingField = currentField.fields.find((f) => f.name.value === path);
if (!existingField) {
existingField = {
@@ -382,7 +385,7 @@ function applyTopLevelFilter(node, fieldPath, filterField) {
if (fieldPath.length > 2) {
// More than one level deep
let currentField = whereArg.value;
fieldPath.slice(1, -1).forEach((path, index) => {
fieldPath.slice(1, -1).forEach((path) => {
let existingField = currentField.fields.find((f) => f.name.value === path);
if (!existingField) {
existingField = {
@@ -468,5 +471,3 @@ function getGraphQLKind(value) {
return Kind.STRING; // GraphQL does not have a Date type, so we return it as a string
}
}
/* eslint-enable no-loop-func */