I am using VS 2013 with version 0.95 of TypeScript, but the linter fails the TS compilation with the error:

我使用的是VS 2013版本0.95的打字稿,但linter错误的TS编译失败:

TsLint: app.ts checked. TsLint: jquery.d.ts compilation failed: TsLint: exceeds maximum line length of 140

TsLint:app.ts检查。TsLint:jquery.d。ts编译失败:TsLint:超过140的最大行长度。

The jquery.d.ts file indeed has lines well over 140 in length, but I can't find the tslint config file to edit the max-line-length value.

jquery.d。ts文件确实有超过140的长度,但是我找不到tslint配置文件来编辑max-line-length值。

I'm using WebEssentials 2013, I haven't installed tslint as part of a package (NPM or Nuget).

我使用WebEssentials 2013,我还没有安装tslint作为软件包的一部分(NPM或Nuget)。

Can anyone point me in the right direction? I'm thinking it might just be easier to set up compile/linting outside of VS for now..

有人能告诉我正确的方向吗?我想现在在VS之外设置编译/链接可能会更容易些。

Thanks.

谢谢。

2 个解决方案

#1


4

I believe that the max-line-length warning is for the length of a single line, rather than for the number of lines in a file.

我相信max-line-length警告的长度是一行的长度,而不是文件中的行数。

You can either break the long lines up to make them smaller, or simply ignore files that aren't "your code".

您可以将长行拆分,使其更小,或者简单地忽略那些不是“您的代码”的文件。

/* tslint:disable */
// the jquery type definition
/* tslint:enable */

or set up your own config:

或者设置自己的配置:

-c, --config:
    The location of the configuration file that tslint will use to
    determine which rules are activated and what options to provide
    to the rules. If no option is specified, the config file named
    tslint.json is used, so long as it exists in the path.
    The format of the file is { rules: { /* rules list */ } },
    where /* rules list */ is a key: value comma-seperated list of
    rulename: rule-options pairs. Rule-options can be either a
    boolean true/false value denoting whether the rule is used or not,
    or a list [boolean, ...] where the boolean provides the same role
    as in the non-list case, and the rest of the list are options passed
    to the rule that will determine what it checks for (such as number
    of characters for the max-line-length rule, or what functions to ban
    for the ban rule).

From https://www.npmjs.org/package/tslint

从https://www.npmjs.org/package/tslint

更多相关文章

  1. 当AJAX响应来自PHP文件时,如何显示以消息为中心的加载器图像&防止
  2. JQuery------获取中的文件内容
  3. 如何在Rails 4(使用jquery)中上传多个文件?
  4. 使用jquery post发布PHP文件
  5. 从JQuery文件输入中获取数据
  6. jQuery LightBox(SlimBox):如何在其中填充ASPX文件?
  7. JQuery和Struts实现Ajax文件上传
  8. 如何在metro javascript和html中读取和写入现有的xml文件
  9. 使用jQuery和AJAX从JSON文件加载数据

随机推荐

  1. Android Jetpack之Lifecycle的源码分析
  2. Android(安卓)四个步骤集成EventBus事件
  3. 2011.09.01(5)——— android checkbox自定
  4. startActivity exposed beyond app throu
  5. Build Android Platform
  6. Android动画之translate(位移动画)
  7. Android中真正的Player
  8. Android(安卓)Studio编译使用了Maven的工
  9. 【学习Android遇到的错误】Unable to res
  10. Android中如何使用自定义对话框