Class: CssDocConfigFile
Defined in: packages/config/src/CssDocConfigFile.ts:51
A loaded cssdoc.json (plus the files it extends), ready to configure a parser.
Properties
extendsFiles
readonly extendsFiles: readonly CssDocConfigFile[];Defined in: packages/config/src/CssDocConfigFile.ts:65
The resolved files this one extends, in declaration order.
fileNotFound
readonly fileNotFound: boolean;Defined in: packages/config/src/CssDocConfigFile.ts:55
Whether the file was absent.
filePath
readonly filePath: string;Defined in: packages/config/src/CssDocConfigFile.ts:53
The absolute path the file was loaded from (or would be, when not found).
messages
readonly messages: readonly string[];Defined in: packages/config/src/CssDocConfigFile.ts:57
Parse/validation/resolution messages collected while loading (this file only).
noStandardTags
readonly noStandardTags: boolean;Defined in: packages/config/src/CssDocConfigFile.ts:59
Whether the file disables the standard tags.
supportForTags
readonly supportForTags: ReadonlyMap<string, boolean>;Defined in: packages/config/src/CssDocConfigFile.ts:63
Per-tag support overrides declared by this file.
tagDefinitions
readonly tagDefinitions: readonly CssDocTagDefinition[];Defined in: packages/config/src/CssDocConfigFile.ts:61
The custom tag definitions declared by this file.
Accessors
hasErrors
Get Signature
get hasErrors(): boolean;Defined in: packages/config/src/CssDocConfigFile.ts:78
Whether this file — or any file it extends — reported an error.
Returns
boolean
Methods
configureParser()
configureParser(configuration): void;Defined in: packages/config/src/CssDocConfigFile.ts:98
Apply this file (and its extends chain) onto a CssDocConfiguration. Extended files are applied first so this file's settings win.
Parameters
configuration
The configuration to mutate.
Returns
void
getErrorSummary()
getErrorSummary(): string;Defined in: packages/config/src/CssDocConfigFile.ts:83
A newline-joined summary of every message from this file and its extends chain.
Returns
string
toConfiguration()
toConfiguration(): CssDocConfiguration;Defined in: packages/config/src/CssDocConfigFile.ts:113
Build a CssDocConfiguration from this file. Convenience for the common case.
Returns
A fresh configuration with this file applied.
loadFile()
static loadFile(filePath): CssDocConfigFile;Defined in: packages/config/src/CssDocConfigFile.ts:126
Load a cssdoc.json from an exact path. Missing files yield a fileNotFound instance (not an error); malformed ones collect messages.
Parameters
filePath
string
The config file path (resolved to absolute).
Returns
CssDocConfigFile
The loaded config file.
loadForFolder()
static loadForFolder(folderPath): CssDocConfigFile;Defined in: packages/config/src/CssDocConfigFile.ts:136
Find and load the nearest cssdoc.json, walking upward from folderPath to the filesystem root.
Parameters
folderPath
string
The folder to start from.
Returns
CssDocConfigFile
The nearest config file, or a fileNotFound instance rooted at folderPath.