| 1 |
import type { Handler } from "gensync"; |
| 2 |
|
| 3 |
import type { |
| 4 |
ConfigFile, |
| 5 |
IgnoreFile, |
| 6 |
RelativeConfig, |
| 7 |
FilePackageData, |
| 8 |
} from "./types"; |
| 9 |
|
| 10 |
import type { CallerMetadata } from "../validation/options"; |
| 11 |
|
| 12 |
export type { ConfigFile, IgnoreFile, RelativeConfig, FilePackageData }; |
| 13 |
|
| 14 |
export function findConfigUpwards( |
| 15 |
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 16 |
rootDir: string, |
| 17 |
): string | null { |
| 18 |
return null; |
| 19 |
} |
| 20 |
|
| 21 |
// eslint-disable-next-line require-yield |
| 22 |
export function* findPackageData(filepath: string): Handler<FilePackageData> { |
| 23 |
return { |
| 24 |
filepath, |
| 25 |
directories: [], |
| 26 |
pkg: null, |
| 27 |
isPackage: false, |
| 28 |
}; |
| 29 |
} |
| 30 |
|
| 31 |
// eslint-disable-next-line require-yield |
| 32 |
export function* findRelativeConfig( |
| 33 |
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 34 |
pkgData: FilePackageData, |
| 35 |
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 36 |
envName: string, |
| 37 |
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 38 |
caller: CallerMetadata | undefined, |
| 39 |
): Handler<RelativeConfig> { |
| 40 |
return { config: null, ignore: null }; |
| 41 |
} |
| 42 |
|
| 43 |
// eslint-disable-next-line require-yield |
| 44 |
export function* findRootConfig( |
| 45 |
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 46 |
dirname: string, |
| 47 |
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 48 |
envName: string, |
| 49 |
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 50 |
caller: CallerMetadata | undefined, |
| 51 |
): Handler<ConfigFile | null> { |
| 52 |
return null; |
| 53 |
} |
| 54 |
|
| 55 |
// eslint-disable-next-line require-yield |
| 56 |
export function* loadConfig( |
| 57 |
name: string, |
| 58 |
dirname: string, |
| 59 |
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 60 |
envName: string, |
| 61 |
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 62 |
caller: CallerMetadata | undefined, |
| 63 |
): Handler<ConfigFile> { |
| 64 |
throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`); |
| 65 |
} |
| 66 |
|
| 67 |
// eslint-disable-next-line require-yield |
| 68 |
export function* resolveShowConfigPath( |
| 69 |
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 70 |
dirname: string, |
| 71 |
): Handler<string | null> { |
| 72 |
return null; |
| 73 |
} |
| 74 |
|
| 75 |
export const ROOT_CONFIG_FILENAMES: string[] = []; |
| 76 |
|
| 77 |
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 78 |
export function resolvePlugin(name: string, dirname: string): string | null { |
| 79 |
return null; |
| 80 |
} |
| 81 |
|
| 82 |
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 83 |
export function resolvePreset(name: string, dirname: string): string | null { |
| 84 |
return null; |
| 85 |
} |
| 86 |
|
| 87 |
export function loadPlugin( |
| 88 |
name: string, |
| 89 |
dirname: string, |
| 90 |
): Handler<{ |
| 91 |
filepath: string; |
| 92 |
value: unknown; |
| 93 |
}> { |
| 94 |
throw new Error( |
| 95 |
`Cannot load plugin ${name} relative to ${dirname} in a browser`, |
| 96 |
); |
| 97 |
} |
| 98 |
|
| 99 |
export function loadPreset( |
| 100 |
name: string, |
| 101 |
dirname: string, |
| 102 |
): Handler<{ |
| 103 |
filepath: string; |
| 104 |
value: unknown; |
| 105 |
}> { |
| 106 |
throw new Error( |
| 107 |
`Cannot load preset ${name} relative to ${dirname} in a browser`, |
| 108 |
); |
| 109 |
} |