For TypeScript related tooling to correctly parse `tsconfig.json` file without depending on TypeScript.
## ⚙️ API
### getTsconfig(searchPath?, configName?)
Searches for a `tsconfig.json` file and parses it. Returns `null` if a config file cannot be found, or an object containing the path and parsed TSConfig object if found.
Returns:
```ts
typeTsconfigResult={
/**
* The path to the tsconfig.json file
*/
path: string
/**
* The resolved tsconfig.json file
*/
config: TsConfigJsonResolved
}
```
#### searchPath
Type: `string`
Default: `process.cwd()`
Accepts a path to a file or directory to search up for a `tsconfig.json` file.
#### configName
Type: `string`
Default: `tsconfig.json`
The file name of the TypeScript config file.
#### Example
```ts
import{getTsconfig}from'get-tsconfig'
// Searches for tsconfig.json starting in the current directory
Pass in the return value from `getTsconfig`, or a `TsconfigResult` object.
#### caseSensitivePaths
Type: `boolean`
By default, it uses [`is-fs-case-sensitive`](https://github.com/privatenumber/is-fs-case-sensitive) to detect whether the file-system is case-sensitive.
Pass in `true` to make it case-sensitive.
#### Example
For example, if it's called with a `tsconfig.json` file that has `include`/`exclude`/`files` defined, the file-matcher will return the config for files that match `include`/`files`, and return `undefined` for files that don't match or match `exclude`.
Given a tsconfig with [`compilerOptions.paths`](https://www.typescriptlang.org/tsconfig#paths) defined, it returns a matcher function.
The matcher function accepts an [import specifier (the path to resolve)](https://nodejs.org/api/esm.html#terminology), checks it against `compilerOptions.paths`, and returns an array of possible paths to check:
```ts
functionpathsMatcher(specifier: string):string[]
```
This function only returns possible paths and doesn't actually do any resolution. This helps increase compatibility wtih file/build systems which usually have their own resolvers.