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 '@mnaoumov/typescript-dev-toolkit/linters/over-exposure';Signature:
export interface OverExposureFileSystemProperties
| Property | Type | Description |
|---|---|---|
| directoryExists | (path: string) => boolean | Checks whether a directory exists. |
| fileExists | (path: string) => boolean | Checks whether a file exists. |
| getCurrentDirectory | () => string | Resolves the directory that relative paths are resolved against. |
| getDirectories | (path: string) => string[] | Lists the immediate subdirectories of a directory. |
| readDirectory | (path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number) => string[] | Lists the files under a directory, filtered by extension and include/exclude patterns. |
| readFile | (path: string) => string | undefined | Reads a file as text. |
Links to this page: