3.46.9 • Published 2 years ago
@structured-types/typescript-config v3.46.9
Table of contents
Overview
Retrieve the configuration for a typescript file.
Installation
$ npm install @structured-types/typescript-config --save-dev
Getting started
import { getTypescriptConfig } from '@structured-types/typescript-config';
import * as ts from 'typescript';
const config = getTypescriptConfig('./tsfile.ts', {
compilerOptions: {
jsx: ts.JsxEmit.ReactJSX,
}
});
API
TSConfigFS
type
defined in @structured-types/typescript-config/misc/typescript-config/src/index.ts
properties
Name | Type |
---|---|
fileExists* | function (filePath *: string ) => Promise <boolean > |
readFile* | function (filePath *: string ) => Promise <(string , null )> |
TSConfigOptions
type
Config parsing options
defined in @structured-types/typescript-config/misc/typescript-config/src/index.ts
properties
Name | Type | Description |
---|---|---|
json | boolean | keep json format of ts config |
host | ts.CompilerHost | optional compiler host to use instead of ts.sys |
getTypescriptConfig
function
Reads any typescript configuration files for a given file, including the extends references
defined in @structured-types/typescript-config/misc/typescript-config/src/index.ts
parameters
Name | Type | Description |
---|---|---|
filePath* | string | the full file path to the file |
defaultConfig | ts.CompilerOptions | optional default configuration |
options | TSConfigOptions | Config parsing options |
returns | ts.CompilerOptions | undefined | the typescript configuration for the file, or undefined if this is not a typescript file |
3.46.9
2 years ago
3.40.0
2 years ago
3.40.5
2 years ago
3.39.5
2 years ago
3.39.6
2 years ago
3.39.7
2 years ago
3.36.0
2 years ago
3.37.0
2 years ago
3.37.1
2 years ago
3.39.3
2 years ago
3.39.4
2 years ago
3.35.0
3 years ago
3.32.0
3 years ago
3.31.0
3 years ago
3.25.0
3 years ago
3.24.3
3 years ago
3.24.2
3 years ago
3.17.0
3 years ago
3.16.5
3 years ago
3.16.2
3 years ago
3.16.0
3 years ago
0.5.2
3 years ago
0.5.1
3 years ago