Tslint: 引用符のルールでは、オプションと重大度は許可されていません。

作成日 2017年05月12日  ·  3コメント  ·  ソース: palantir/tslint

バグレポート

  • __TSLintバージョン__:5.2.0
  • __TypeScriptバージョン__:2.3.1
  • __TSLintの実行__ :( 1つ選択)CLI / Node.js API / VSCode / grunt-tslint / Atom / Visual Studio / etc

lintedされているTypeScriptコード

import { BottomSheetKey, BottomSheetService } from "bottomSheet";
import { INavItem, NavHeight } from 'core/services/nav.service';
import { Configuration } from './app.configuration';

tslint.json構成の場合:

{
    "defaultSeverity": "error",
    "extends": [
        "tslint:recommended"
    ],
    "jsRules": {},
    "rules": {
        "quotemark": {
            "options": [ true, "single", "avoid-escape" ],
            "severity": "warning"
        }
    },
}

実際の動作

quotemarkルールは無視されます。

予想される行動

"bottomSheet"で提供されたスニペットの1行目のquotemarkルールから警告が報告されるはずです。

考え

これはルールの大きな問題になる可能性がありますが、私はquotemarkしか観察していません。

Question

最も参考になるコメント

重大度とオプションを含む新しい構成形式を使用する場合は、
最初のオプションはtrueです。 配列から削除すると、ルール
期待どおりに動作するはずです。

午前12.05.201718:07シュリーブ「ジェイコブロバートソン」 [email protected]

バグレポート

  • TSLintバージョン:5.2.0
  • TypeScriptバージョン:2.3.1
  • 経由でTSLintを実行する:(1つ選択)CLI / Node.js API / VSCode /
    grunt-tslint / Atom / Visual Studio /など

lintedされているTypeScriptコード

import {BottomSheetKey、BottomSheetService} from "bottomSheet"; import {INavItem、NavHeight} from'core / services / nav.service '; import {Configuration} from' ./ app.configuration ';

tslint.json構成の場合:

{{
"defaultSeverity": "エラー"、
"拡張":[
" tslint:recommended "
]、
"jsRules":{}、
「ルール」:{
"quotemark":{
"オプション":[true、 "single"、 "avoid-escape"]、
「重大度」:「警告」
}
}、
}

実際の動作

引用符の規則は無視されます。
予想される行動

の1行目の引用符ルールから警告が報告されるはずです。
「bottomSheet」で提供されるスニペット。
考え

これはルールの大きな問題になる可能性がありますが、私はそれを観察しただけです
引用符。


このスレッドにサブスクライブしているため、これを受け取っています。
このメールに直接返信し、GitHubで表示してください
https://github.com/palantir/tslint/issues/2746 、またはスレッドをミュートします
https://github.com/notifications/unsubscribe-auth/ALaeKN8MtJyisZmnL1SJfgTyAIcaUQPJks5r5IOlgaJpZM4NZfAU

全てのコメント3件

重大度とオプションを含む新しい構成形式を使用する場合は、
最初のオプションはtrueです。 配列から削除すると、ルール
期待どおりに動作するはずです。

午前12.05.201718:07シュリーブ「ジェイコブロバートソン」 [email protected]

バグレポート

  • TSLintバージョン:5.2.0
  • TypeScriptバージョン:2.3.1
  • 経由でTSLintを実行する:(1つ選択)CLI / Node.js API / VSCode /
    grunt-tslint / Atom / Visual Studio /など

lintedされているTypeScriptコード

import {BottomSheetKey、BottomSheetService} from "bottomSheet"; import {INavItem、NavHeight} from'core / services / nav.service '; import {Configuration} from' ./ app.configuration ';

tslint.json構成の場合:

{{
"defaultSeverity": "エラー"、
"拡張":[
" tslint:recommended "
]、
"jsRules":{}、
「ルール」:{
"quotemark":{
"オプション":[true、 "single"、 "avoid-escape"]、
「重大度」:「警告」
}
}、
}

実際の動作

引用符の規則は無視されます。
予想される行動

の1行目の引用符ルールから警告が報告されるはずです。
「bottomSheet」で提供されるスニペット。
考え

これはルールの大きな問題になる可能性がありますが、私はそれを観察しただけです
引用符。


このスレッドにサブスクライブしているため、これを受け取っています。
このメールに直接返信し、GitHubで表示してください
https://github.com/palantir/tslint/issues/2746 、またはスレッドをミュートします
https://github.com/notifications/unsubscribe-auth/ALaeKN8MtJyisZmnL1SJfgTyAIcaUQPJks5r5IOlgaJpZM4NZfAU

ええ、それはうまくいきます。 ありがとう!

から行く方法についてのドキュメントで良い例を見つけることができませんでした

    "rules": {
         "quotemark": [ true, "single", "avoid-escape" ],
    }

    "rules": {
        "quotemark": {
            "options": [ "single", "avoid-escape" ],
            "severity": "warning"
        }
    }

この微妙な違いはどこかで言及されていますか?

@ jacob-robertsonはい、 5.0.0リリースノートと変更ログの注目すべき機能と拡張機能のセクションにあります。

このページは役に立ちましたか?
0 / 5 - 0 評価