Repository: babel/babel
File: packages/babel-types/test/fields.js (JavaScript)

Code before:
          case "loc":
          case "range":
          case "leadingComments":
          case "innerComments":
          case "trailingComments":
          case "comments":
          case "extra":
            continue;
        }
        if (!fields[field]) {
          if (ignoredFields[type] && ignoredFields[type][field]) continue;
          if (missingFields === null) missingFields = {};
          if (!missingFields[type]) missingFields[type] = {};
          if (!missingFields[type][field]) {
            missingFields[type][field] = true;
          }
        }

        if (
          !VISITOR_KEYS[type].includes(field) &&
          node[field] != null &&
          typeof node[field] === "object" &&
          node[field].type &&
          !(
            ignoredVisitorKeysCheckTypes[type] === true ||
            ignoredVisitorKeysCheckTypes[type]?.[field] === true
          )
        ) {
          throw new Error(
            `${type}.${field} is an AST node (type=${node[field].type}), but "${field}" is missing in "${type}"'s current visitors definition: ${inspect(VISITOR_KEYS[type])}`,
          );
        }
      }

      if (missingFields !== null) {
        throw new Error(
          `The following NODE_FIELDS were missing: ${inspect(missingFields)}`,
        );
      }

      if (type === "ObjectTypeInternalSlot" || type === "ObjectTypeProperty") {
        // We don't validate the visitor order of ObjectTypeInternalSlot and
        // ObjectTypeProperty because their fields' locations intersect. In
        //    interface { [[foo]](): X }
        // there is a field "key" covering `foo`, and a field "value" covering
        // `[[foo]](): X`. Same for `interface { get foo(): X }`.
        // The defined visitor order is that they key is visited first.
        return;
      }

      const keys = VISITOR_KEYS[type];

Review comment (suggestion):
```suggestion
            (ignoredVisitorKeysCheckTypes[type] && ignoredVisitorKeysCheckTypes[type][field] === true)
```

to fix ci

Code after:
          case "loc":
          case "range":
          case "leadingComments":
          case "innerComments":
          case "trailingComments":
          case "comments":
          case "extra":
            continue;
        }
        if (!fields[field]) {
          if (ignoredFields[type] && ignoredFields[type][field]) continue;
          if (missingFields === null) missingFields = {};
          if (!missingFields[type]) missingFields[type] = {};
          if (!missingFields[type][field]) {
            missingFields[type][field] = true;
          }
        }

        if (
          !VISITOR_KEYS[type].includes(field) &&
          node[field] != null &&
          typeof node[field] === "object" &&
          node[field].type &&
          !(
            ignoredVisitorKeysCheckTypes[type] === true ||
            (ignoredVisitorKeysCheckTypes[type] !== undefined &&
              ignoredVisitorKeysCheckTypes[type][field] === true)
          )
        ) {
          throw new Error(
            `${type}.${field} is an AST node (type=${node[field].type}), but "${field}" is missing in "${type}"'s current visitors definition: ${inspect(VISITOR_KEYS[type])}`,
          );
        }
      }

      if (missingFields !== null) {
        throw new Error(
          `The following NODE_FIELDS were missing: ${inspect(missingFields)}`,
        );
      }

      if (type === "ObjectTypeInternalSlot" || type === "ObjectTypeProperty") {
        // We don't validate the visitor order of ObjectTypeInternalSlot and
        // ObjectTypeProperty because their fields' locations intersect. In
        //    interface { [[foo]](): X }
        // there is a field "key" covering `foo`, and a field "value" covering
        // `[[foo]](): X`. Same for `interface { get foo(): X }`.
        // The defined visitor order is that they key is visited first.
        return;
      }