Skip to content

@gluonjs/core / packages/compiler/src/diagnostics / GluonDiagnosticDefinition

Interface: GluonDiagnosticDefinition ​

Properties ​

after? ​

readonly optional after?: string


before? ​

readonly optional before?: string


code ​

readonly code: string


compactCode ​

readonly compactCode: `G${number}`


id ​

readonly id: number


remediation ​

readonly remediation: string


source ​

readonly source: GluonDiagnosticSource


summary ​

readonly summary: string


title ​

readonly title: string


why ​

readonly why: string

Example ​

Consume the stable identity, summary, cause, remediation, source, and optional repair example for one diagnostic:

ts
import {
  GLUON_DIAGNOSTIC_CATALOG_VERSION,
  formatGluonDiagnostic,
  getGluonDiagnostic,
  gluonDiagnosticCatalog,
  gluonDiagnosticReferenceUrl,
  type GluonDiagnosticDefinition,
  type GluonDiagnosticSource,
} from '@gluonjs/compiler/diagnostics';

const definition: GluonDiagnosticDefinition | undefined =
  getGluonDiagnostic('GLUON_TEMPLATE_SLOT_UNKNOWN');
const source: GluonDiagnosticSource | undefined = definition?.source;
const message = formatGluonDiagnostic('GLUON_TEMPLATE_SLOT_UNKNOWN', 'product-card.ts:12');
const productionMessage = formatGluonDiagnostic('GLUON_TEMPLATE_SLOT_UNKNOWN', '', { production: true });
const url = gluonDiagnosticReferenceUrl('G1111', '/gluon/diagnostics');
console.log(GLUON_DIAGNOSTIC_CATALOG_VERSION, gluonDiagnosticCatalog.length, source, message, productionMessage, url);

Version-matched documentation. Examples are checked against the public package contracts.