Skip to content

Improvements to error message for incompatible tsconfigs #532

Closed
@renewooller

Description

@renewooller

Hi, this is a fantastic project, thanks for it.

I have some feedback for small improvements that could substantially improve the initial experience when working with random tsconfigs

When the tsconfig.json is incompatible with ts-node, we currently get an error like so:

SyntaxError: Unexpected token ] in JSON at position 152
    at JSON.parse (<anonymous>)
    at parse (/usr/local/opt/nvm/versions/node/v8.5.0/lib/node_modules/ts-
...

What would be great is if a JSON-schema or similar was defined for the tsconfig, and the incoming tsconfig.json was validated against the schema first before attempting to use it, so the error would then be something like:

ValidationError: tsconfig.json cannot have "include" member

An example of a ts-node compatible tsconfig in the documentation would also be useful - perhaps this can be driven off the same json-schema.

Let me know if you agree and what techniques you prefer and point me to where the most suitable places to make the changes and I'll do a pull request.

All the best.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions