全局Visual Studio 2013 TypeScript标志 [英] Global Visual Studio 2013 TypeScript Flags

查看:120
本文介绍了全局Visual Studio 2013 TypeScript标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在解决方案文件夹中编写TypeScript作为解决方案. TypeScript将由gulp中定义的任务处理,并将其放置在Web项目中的适当位置,这样就不会包含"ts"文件.

I am writing TypeScript in a solution folder as a solution item. TypeScript will be processed by a task defined in gulp and placed at the proper position within the web project, so that 'ts' files are not included.

当尝试使用"amd"和"es6"功能时,除非设置了诸如"--target"和"--module"之类的特定标志,否则Visual Studio IntelliSense无法理解这些功能,这里的问题是我在一个项目中不工作.

When trying to work with 'amd' and 'es6' features, Visual Studio IntelliSense doesn't understand those features unless specific flags are set like '--target' and '--module', the issue here is that I am not working within a project.

我正在考虑解决此问题,以在全局级别设置特定的TypeScript标志.

I was thinking to fix this to set specific TypeScript flags at global level.

因此,我开始查看文件夹"C:\ Program Files(x86)\ MSBuild \ Microsoft \ VisualStudio \ v12.0 \ TypeScript"中的文件"Microsoft.TypeScript.Default.props",并应用了特定的标志设置,不幸的是,这不能解决问题.

So I started to look at the file 'Microsoft.TypeScript.Default.props' in folder 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript' and applied specific flag settings, but unfortunately this does not fix the issue.

有人知道如何在全局(默认)级别应用TypeScript标志吗?

Does anyone know how to apply TypeScript flags at global (default) level?

推荐答案

您可以使用tsconfig文件来设置这些... John Reilly的tsconfig中对此进行了详细描述. json文章.

You can use a tsconfig file to set these... as per this example from the TypeScript project. This is described in good detail in John Reilly's tsconfig.json article.

{
    "compilerOptions": {
        "module": "commonjs",
        "noImplicitAny": true,
        "removeComments": true,
        "preserveConstEnums": true,
        "out": "../../built/local/tsc.js",
        "sourceMap": true
    },
    "files": [
        "core.ts",
        "sys.ts",
        "types.ts",
        "scanner.ts",
        "parser.ts",
        "utilities.ts",
        "binder.ts",
        "checker.ts",
        "emitter.ts",
        "program.ts",
        "commandLineParser.ts",
        "tsc.ts",
        "diagnosticInformationMap.generated.ts"
    ]
}

tsconfig文件被设计为指定此信息的跨IDE方法-因此它仅适用于尊重该信息的IDE-并且它是

The tsconfig file is designed to be a cross-IDE method of specifying this information - so it will only apply within an IDE that respects it - and it is part of this issue on GitHub.

这篇关于全局Visual Studio 2013 TypeScript标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆