You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could also be an object representing a pre-parsed typescript config.
but that could be two different things:
1) raw json
Meaning that you read the tsconfig.json file and apply JSON.parse()
In this case, the compiler options are tsconfig.compilerOptions. The module setting tsconfig.compilerOptions.module is a string, for example 'CommonJs'. And if you want to be able to resolve index.ts files then it better be that value.
filing-cabinet still needs to convert the raw json to typescript's own format before using it.
2) parsed using typescript's api to parse the config file
That is, using typescript.parseJsonSourceFileConfigFileContent
In this case, the compiler options are tsconfig.options. The module setting tsconfig.options.module is a number, for example the number-based enum value typescript.ModuleKind.CommonJS. And if you want to be able to resolve index.ts files then it better be that value.
This is the preferred usage if you care about resolution speed for multiple files as typescript doesn't have to re-parse its configuration.
There is no api to go from 2) back to 1), only from 1) to 2).
Problem
Passing 2) into filing-cabinet means that the module is typescript configuration is accidentally undefined. Filing-cabinet then defaults to typescript.ModuleKind.AMD which does not include index.ts files.
madge tries to hack around that by trying to convert 2) back to 1), but unsuccessfully so: pahen/madge#271, pahen/madge#322
Instead, filing-cabinet should accept both kinds of tsConfig objects and handle them according to wether tsConfig.compilerOptions or tsConfig.options is present.
The text was updated successfully, but these errors were encountered:
The documentation says
but that could be two different things:
1) raw json
Meaning that you read the
tsconfig.json
file and applyJSON.parse()
In this case, the compiler options are
tsconfig.compilerOptions
. The module settingtsconfig.compilerOptions.module
is a string, for example'CommonJs'
. And if you want to be able to resolveindex.ts
files then it better be that value.filing-cabinet still needs to convert the raw json to typescript's own format before using it.
2) parsed using typescript's api to parse the config file
That is, using
typescript.parseJsonSourceFileConfigFileContent
In this case, the compiler options are
tsconfig.options
. The module settingtsconfig.options.module
is a number, for example the number-based enum valuetypescript.ModuleKind.CommonJS
. And if you want to be able to resolveindex.ts
files then it better be that value.This is the preferred usage if you care about resolution speed for multiple files as typescript doesn't have to re-parse its configuration.
There is no api to go from 2) back to 1), only from 1) to 2).
Problem
Passing 2) into filing-cabinet means that the
module
is typescript configuration is accidentally undefined. Filing-cabinet then defaults totypescript.ModuleKind.AMD
which does not includeindex.ts
files.madge tries to hack around that by trying to convert 2) back to 1), but unsuccessfully so: pahen/madge#271, pahen/madge#322
Instead, filing-cabinet should accept both kinds of tsConfig objects and handle them according to wether
tsConfig.compilerOptions
ortsConfig.options
is present.The text was updated successfully, but these errors were encountered: