打印版本的 TypeScript

Print version of TypeScript

我关注tsconfig.json:

{
  "compileOnSave": true,
  "compilerOptions": {
    "target": "ES5",
    "sourceMap": true,
    "module": "system",
    "moduleResolution": "node",
    "alwaysStrict": true,
    "version": true
  },
  "exclude": [
    "**/*.d.ts"
  ]
}

并查看 https://www.typescriptlang.org/docs/handbook/compiler-options.html --version flat 应该打印 TypeScript 的版本,但它不起作用。为什么?

--version 是几个只在命令行上有效的特殊用途选项之一,在 tsconfig.json 中无效。它使编译器打印 而不是 编译代码的版本,因此在 tsconfig.json 中永久启用该选项无论如何都不会很有用。