Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/client/features/pages-editor/hooks/useBufferLint

Cockpit client (features), next. Source: ui/client/features/pages-editor/hooks/useBufferLint.tsx.

Functions#

useBufferLint()#

useBufferLint(feature, file, source, enabled): object

Defined in: ui/client/features/pages-editor/hooks/useBufferLint.tsx:16

— replaces "diagnostics only after save": while enabled and source is being edited, re-lints the unsaved buffer (never written to disk) a debounce tick after the last keystroke, so Monaco markers track what is typed rather than what was last saved. One in-flight request at a time — a response that arrives after a newer one was already requested is dropped, so a slow lint can never overwrite a fresher result.

Parameters#

feature

string

file

string

source

string

enabled

boolean

Returns#

object

diagnostics

diagnostics: SourceDiagnostic[]

linting

linting: boolean

markers

markers: SourceMarker[]

summary

summary: DiagnosticSummary

summaryText

summaryText: string