Skip to content

Not possible to ignore tsconfig.json #456

Description

@NaridaL

I'm trying to get ts-node to behave as if there was no tsconfig in the current directory. Unless I'm misunderstanding the readme (https://github.com/TypeStrong/ts-node#loading-tsconfigjson), this should be possible...

in an empty directory:

PS C:\Users\aval\tsdev\nla\tsnodetest> echo "ERROR" > tsconfig.json
PS C:\Users\aval\tsdev\nla\tsnodetest> echo "console.log('foobar')" > index.ts
PS C:\Users\aval\tsdev\nla\tsnodetest> node -v
v8.7.0
PS C:\Users\aval\tsdev\nla\tsnodetest> npm -v
5.5.1
PS C:\Users\aval\tsdev\nla\tsnodetest> npm list ts-node -g
C:\npm
+-- ts-node@3.3.0
PS C:\Users\aval\tsdev\nla\tsnodetest> ts-node -P false .\index.ts
TypeError: The specified path does not exist: false
    at resolveSync (C:\npm\node_modules\ts-node\node_modules\tsconfig\src\tsconfig.ts:72:9)
    at Object.loadSync (C:\npm\node_modules\ts-node\node_modules\tsconfig\src\tsconfig.ts:140:16)
    at readConfig (C:\npm\node_modules\ts-node\src\index.ts:425:18)
    at Object.register (C:\npm\node_modules\ts-node\src\index.ts:189:18)
    at Object.<anonymous> (C:\npm\node_modules\ts-node\src\_bin.ts:140:17)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
PS C:\Users\aval\tsdev\nla\tsnodetest> ts-node -n .\index.ts
SyntaxError: Unexpected token � in JSON at position 0
    at JSON.parse (<anonymous>)
    at parse (C:\npm\node_modules\ts-node\node_modules\tsconfig\src\tsconfig.ts:195:15)
    at readFileSync (C:\npm\node_modules\ts-node\node_modules\tsconfig\src\tsconfig.ts:181:10)
    at Object.loadSync (C:\npm\node_modules\ts-node\node_modules\tsconfig\src\tsconfig.ts:151:18)
    at readConfig (C:\npm\node_modules\ts-node\src\index.ts:425:18)
    at Object.register (C:\npm\node_modules\ts-node\src\index.ts:189:18)
    at Object.<anonymous> (C:\npm\node_modules\ts-node\src\_bin.ts:140:17)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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