Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// When using local connector to read local files, 'content' is empty.
let result = parseJSON(response.body.content, 'extends');
if (isPackageJson && !result.data.babel) {
return;
}
await this.engine.emitAsync('parse::start::babel-config', { resource });
// `result.scope('babel')` won't be null since `result.data.babel` was confirmed to exist above.
result = isPackageJson ? result.scope('babel')! : result;
config = result.data;
const originalConfig: BabelConfig = cloneDeep(config);
const finalConfig = calculateFinalConfig(config, resource);
if (finalConfig instanceof Error) {
await this.engine.emitAsync(`parse::error::babel-config::extends`,
{
error: finalConfig,
getLocation: result.getLocation,
resource
});
return;
}
if (!finalConfig) {
return;
}
* tsconfig.schema.json
*/
if (!fileName.match(/^tsconfig\.([^.]*\.)?json$/gi) || fileName === 'tsconfig.schema.json') {
return;
}
await this.engine.emitAsync(`parse::start::typescript-config`, { resource });
let result: IJSONResult;
try {
result = parseJSON(fetchEnd.response.body.content);
const originalConfig = cloneDeep(result.data);
const config = finalConfig(result.data, resource);
if (config instanceof Error) {
await this.engine.emitAsync(`parse::error::typescript-config::extends`,
{
error: config,
getLocation: result.getLocation,
resource: config.resource
});
return;
}
if (!config) {
return;
}