Skip to content

OverExposureFileSystem

The subset of file-system operations the language-service host needs. Injecting this (rather than always using typescript’s sys) lets tests drive the analyzer against in-memory sources with no real file-system access.

Import:

import type { OverExposureFileSystem } from 'obsidian-dev-utils/script-utils/linters/over-exposure';

Signature:

export interface OverExposureFileSystem

Methods

MethodReturnsDescription
directoryExists(this, path)booleanChecks whether a directory exists.
fileExists(this, path)booleanChecks whether a file exists.
getCurrentDirectory(this)stringResolves the directory that relative paths are resolved against.
getDirectories(this, path)string[]Lists the immediate subdirectories of a directory.
readDirectory(this, path, extensions?, exclude?, include?, depth?)string[]Lists the files under a directory, filtered by extension and include/exclude patterns.
readFile(this, path)string | undefinedReads a file as text.

Links to this page: