Skip to content

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

ts
readonly extendsFiles: readonly CssDocConfigFile[];

Defined in: packages/config/src/CssDocConfigFile.ts:65

The resolved files this one extends, in declaration order.


fileNotFound

ts
readonly fileNotFound: boolean;

Defined in: packages/config/src/CssDocConfigFile.ts:55

Whether the file was absent.


filePath

ts
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

ts
readonly messages: readonly string[];

Defined in: packages/config/src/CssDocConfigFile.ts:57

Parse/validation/resolution messages collected while loading (this file only).


noStandardTags

ts
readonly noStandardTags: boolean;

Defined in: packages/config/src/CssDocConfigFile.ts:59

Whether the file disables the standard tags.


supportForTags

ts
readonly supportForTags: ReadonlyMap<string, boolean>;

Defined in: packages/config/src/CssDocConfigFile.ts:63

Per-tag support overrides declared by this file.


tagDefinitions

ts
readonly tagDefinitions: readonly CssDocTagDefinition[];

Defined in: packages/config/src/CssDocConfigFile.ts:61

The custom tag definitions declared by this file.

Accessors

hasErrors

Get Signature

ts
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()

ts
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

CssDocConfiguration

The configuration to mutate.

Returns

void


getErrorSummary()

ts
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()

ts
toConfiguration(): CssDocConfiguration;

Defined in: packages/config/src/CssDocConfigFile.ts:113

Build a CssDocConfiguration from this file. Convenience for the common case.

Returns

CssDocConfiguration

A fresh configuration with this file applied.


loadFile()

ts
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()

ts
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.

Released under the MIT License