function makeOptionsSchema(additionalProperties) {
  /** @type {import('./moduleVisitor').Schema} */
  const base =  {
    type: 'object',
    properties: {
      commonjs: { type: 'boolean' },
      amd: { type: 'boolean' },
      esmodule: { type: 'boolean' },
      ignore: {
        type: 'array',
        minItems: 1,
        items: { type: 'string' },
        uniqueItems: true,
      },
    },
    additionalProperties: false,
  };

  if (additionalProperties) {
    for (const key in additionalProperties) {
      // @ts-expect-error TS always has trouble with arbitrary object assignment/mutation
      base.properties[key] = additionalProperties[key];
    }
  }

  return base;
}
make an options schema for the module visitor, optionally adding extra fields.
@type {import('./moduleVisitor').makeOptionsSchema}