Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support comments and other valid tsconfig.json features #1

Open
jfsiii opened this issue Mar 3, 2021 · 0 comments
Open

Support comments and other valid tsconfig.json features #1

jfsiii opened this issue Mar 3, 2021 · 0 comments

Comments

@jfsiii
Copy link

jfsiii commented Mar 3, 2021

I ran ts-import-types-cli -p path/to/tsconfig.json -d and it failed with

SyntaxError: /Users/jfsiii/work/kibana/x-pack/plugins/fleet/tsconfig.json: Unexpected token } in JSON at position 212
    at parse (<anonymous>)
    at Object.Module._extensions..json (internal/modules/cjs/loader.js:1106:22)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/ts-import-types-cli/dist/bin.js:45:5)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
ts-import-types-cli --project /Users/jfsiii/work/kibana/x-pack/plugins/fleet/tsconfig.json is not a tsconfig.json file

The config file had comments. Removing them fixed the error.

Comments are supported in tsconfig.json (e.g. microsoft/TypeScript#5450)

I think the CLI should fail using valid config files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant