'警告:ts.isWhiteSpaceLike不是'运行tslint的函数?

时间:2017-05-30 15:06:15

标签: typescript lint tslint

如果这是tslint中的错误或我定义的规则不正确的任何想法?

正在运行tslint

./node_modules/tslint/bin/tslint -p src/tsconfig.json --type-check src/polyfills.ts 
Warning: ts.isWhiteSpaceLike is not a function

polyfill.ts

import 'core-js/es6';
import 'core-js/es7/reflect';
require('zone.js/dist/zone');
const PROPERTY_KEY = 'stackTraceLimit';
Error[PROPERTY_KEY] = Infinity;
require('zone.js/dist/long-stack-trace-zone');

tslint.json

{
  "rules": {
    "class-name": true,
    "comment-format": [true, "check-space"],
    "curly": true,
    "eofline": true,
    "forin": true,
    "indent": [false, "spaces"],
    "label-position": true,
    "max-line-length": [true, 200],
    "member-access": true,
    "member-ordering": [true,
      "public-before-private",
      "static-before-instance",
      "variables-before-functions"
    ],
    "no-arg": true,
    "no-bitwise": true,
    "no-console": [true,
      "debug",
      "info",
      "time",
      "timeEnd",
      "trace"
    ],
    "no-construct": true,
    "no-debugger": true,
    "no-duplicate-variable": true,
    "no-empty": true,
    "no-eval": true,
    "no-inferrable-types": true,
    "no-shadowed-variable": true,
    "no-string-literal": true,
    "no-switch-case-fall-through": true,
    "no-trailing-whitespace": true,
    "no-unused-expression": true,
    "no-unused-variable": true,
    "no-use-before-declare": true,
    "no-var-keyword": true,
    "object-literal-sort-keys": true,
    "one-line": [true,
      "check-open-brace",
      "check-catch",
      "check-else",
      "check-finally",
      "check-whitespace"
    ],
    "quotemark": [false, "double", "avoid-escape"],
    "radix": true,
    "semicolon": [true, "always"],
    "trailing-comma": [true, {
      "singleline": "never",
      "multiline": "never"
    }],
    "triple-equals": [true, "allow-null-check"],
    "typedef-whitespace": [true, {
      "call-signature": "nospace",
      "index-signature": "nospace",
      "parameter": "nospace",
      "property-declaration": "nospace",
      "variable-declaration": "nospace"
    }],
    "variable-name": false,
    "whitespace": [true,
      "check-branch",
      "check-decl",
      "check-operator",
      "check-separator",
      "check-type"
    ]
  }
}

0 个答案:

没有答案