我認爲max-line-length
警告是針對單行的長度,而不是針對文件中的行數。
您可以打破長排來縮小尺寸,或者簡單地忽略不是「您的代碼」的文件。
/* tslint:disable */
// the jquery type definition
/* tslint:enable */
或建立自己的配置:
-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).
從https://www.npmjs.org/package/tslint
對不起,史蒂夫,你誤解了我的問題。 1)我知道這是線的長度(「有長度超過140線」 - 從上面)。 2)我沒有更改jquery.d.ts文件,因爲它是在DefinitelyTyped回購([link] https://github.com/borisyankov/DefinitelyTyped)上創建並存儲的第三方標準。 3)它在Visual Studio 2013中,並且沒有--config開關。 – Astravagrant
嗨史蒂夫,我想我會嘗試在[Github](https://github.com/borisyankov/DefinitelyTyped/pull/1711)上編輯該文件,並且已經開始了拉取請求,但是沒有TS理解來重構幾個接口定義。我優先考慮不必更改默認值(因爲,爲什麼)和開箱即用的W.E. 2013年整合。 – Astravagrant
如果TSLint獲得了牽引力,那麼默認情況下,項目可能會願意將忽略規則添加到'.d.ts'文件。您希望TSLint檢查*您的*代碼而不是*外部*代碼和定義是否正確? – Fenton