Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
: options.propFilter,
shouldExtractLiteralValuesFromEnum:
options.shouldExtractLiteralValuesFromEnum,
};
// Configure parser using settings provided to loader.
// See: node_modules/react-docgen-typescript/lib/parser.d.ts
let parser: FileParser = withDefaultConfig(parserOptions);
let compilerOptions: ts.CompilerOptions = {
allowJs: true,
};
let tsConfigFile: ts.ParsedCommandLine | null = null;
if (options.tsconfigPath) {
parser = withCustomConfig(options.tsconfigPath, parserOptions);
tsConfigFile = getTSConfigFile(options.tsconfigPath!);
compilerOptions = tsConfigFile.options;
const filesToLoad = tsConfigFile.fileNames;
loadFiles(filesToLoad);
} else if (options.compilerOptions) {
parser = withCompilerOptions(options.compilerOptions, parserOptions);
compilerOptions = options.compilerOptions;
}
if (!tsConfigFile) {
const basePath = path.dirname(context.context);
tsConfigFile = getDefaultTSConfigFile(basePath);
const filesToLoad = tsConfigFile.fileNames;