Skip to content

TSConfig defaults is a dead code path #84

Closed
@dcherman

Description

@dcherman

The default tsconfig here

const defaultTypescriptConfig = {
'compilerOptions': {
'target': 'es5',
'lib': [
'dom',
'es6'
],
'module': 'es2015',
'moduleResolution': 'node',
'types': ['vue-typescript-import-dts', 'jest', 'node'],
'isolatedModules': false,
'experimentalDecorators': true,
'noImplicitAny': true,
'noImplicitThis': true,
'strictNullChecks': true,
'removeComments': true,
'emitDecoratorMetadata': true,
'suppressImplicitAnyIndexErrors': true,
'allowSyntheticDefaultImports': true,
'sourceMap': true,
'allowJs': true
}
}

Will never be hit since loadSync provides an empty set of defaults if no tsconfig.json is found

https://github.com/TypeStrong/tsconfig/blob/5281eafd459a574343bab1bfb8d2ec004cd07355/src/tsconfig.ts#L142-L148

Which means this condition is never falsy in any scenario

if (!config) {
logger.info('no tsconfig.json found, defaulting to default typescript options')
}
const typescriptConfig = config || defaultTypescriptConfig

We should probably swap that out for resolveSync to see if we would have found a tsconfig.json before attempting to load it if we want these defaults to be used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions