Skip to main content

Function: stripInlineComment()

stripInlineComment(line: string): string

Defined in: _internal/config-file-scanner.ts:93

Strips any trailing inline comment from a YAML line and returns the trimmed content before the first # character.

When no # is present the entire trimmed line is returned. This helper is used by rules that scan for specific keys or values without a full YAML parser.

Parameters​

line​

string

Returns​

string