BaseDiagnostic import type {BaseDiagnostic} from '@fuzdev/fuz_css/diagnostics.js'; Base diagnostic with common fields.
level
type "error" | "warning"
message
type string
suggestion
type string | null
Diagnostic types for CSS class extraction and generation.
Provides a unified diagnostic system across all phases:
12 declarations
BaseDiagnostic import type {BaseDiagnostic} from '@fuzdev/fuz_css/diagnostics.js'; Base diagnostic with common fields.
leveltype "error" | "warning"
messagetype string
suggestiontype string | null
internal
The dispatch the generators share - not stable API.
(options: DiagnosticDispatchOptions, sink: DiagnosticSink): (diagnostics: Diagnostic[]) => void import {create_diagnostic_dispatcher} from '@fuzdev/fuz_css/diagnostics.js'; Creates the diagnostic dispatch a generator runs after each render: a
diagnostic level set to 'throw' fails the render with a
CssGenerationError, and the rest are logged to sink - except that a
message the previous dispatch already logged isn't logged again.
A render reports every file's diagnostics, so a dev server or watch mode re-rendering on each edit would otherwise repeat every warning in the project on every change. A diagnostic that goes away and comes back is logged again.
optionsthe on_error/on_warning settings
sinkwhere logged diagnostics go
(diagnostics: Diagnostic[]) => void the dispatch, to call with each render's diagnostics
CssGenerationError - from the returned dispatch, for a level set to `'throw'`(diagnostic: InterpreterDiagnostic, locations: SourceLocation[] | null): GenerationDiagnostic import {create_generation_diagnostic} from '@fuzdev/fuz_css/diagnostics.js'; Converts an InterpreterDiagnostic to a GenerationDiagnostic with locations.
diagnosticinterpreter diagnostic to convert
locationssource locations where the class was used
SourceLocation[] | nullGenerationDiagnostic import {CssGenerationError} from '@fuzdev/fuz_css/diagnostics.js'; Error thrown when CSS generation encounters errors or warnings
(depending on on_error and on_warning settings).
Contains the full diagnostics array for programmatic access.
Errordiagnosticstype Diagnostic[]
constructortype new (diagnostics: Diagnostic[]): CssGenerationError
diagnosticsDiagnostic[]Diagnostic type ExtractionDiagnostic | GenerationDiagnostic
import type {Diagnostic} from '@fuzdev/fuz_css/diagnostics.js'; Union of all diagnostic types.
internal
The dispatch the generators share - not stable API.
DiagnosticDispatchOptions import type {DiagnosticDispatchOptions} from '@fuzdev/fuz_css/diagnostics.js'; How generation diagnostics are handled - see CssDiagnosticsOptions.
on_errortype "log" | "throw"
on_warningtype "log" | "throw" | "ignore"
internal
The dispatch the generators share - not stable API.
DiagnosticSink import type {DiagnosticSink} from '@fuzdev/fuz_css/diagnostics.js'; Where a dispatcher writes the diagnostics it logs.
warntype (message: string): void
messagestringvoiderrortype (message: string): void
messagestringvoidExtractionDiagnostic import type {ExtractionDiagnostic} from '@fuzdev/fuz_css/diagnostics.js'; Diagnostic from the extraction phase.
phasetype "extraction"
locationtype SourceLocation
(d: Diagnostic): string import {format_diagnostic} from '@fuzdev/fuz_css/diagnostics.js'; Formats a diagnostic for display.
dstring GenerationDiagnostic import type {GenerationDiagnostic} from '@fuzdev/fuz_css/diagnostics.js'; Diagnostic from the generation phase.
phasetype "generation"
leveltype "error" | "warning"
messagetype string
suggestiontype string | null
identifierThe class name, element name, or variable name this diagnostic refers to
type string
locationsSource locations where this class was used, or null if from additional_classes
type SourceLocation[] | null
InterpreterDiagnostic import type {InterpreterDiagnostic} from '@fuzdev/fuz_css/diagnostics.js'; Diagnostic from CSS class interpretation. Used internally by interpreters; converted to GenerationDiagnostic with locations.
leveltype "error" | "warning"
messagetype string
identifierThe class name, element name, or variable name this diagnostic refers to
type string
suggestiontype string | null
SourceLocation import type {SourceLocation} from '@fuzdev/fuz_css/diagnostics.js'; Source location for IDE/LSP integration.
filetype string
line1-based line number
type number
column1-based column number
type number