Tslint: When upgrading from 5.9.1 to 5.10.0 out of memory error and other strange behaviours occur

Created on 5 Jun 2018  ·  11Comments  ·  Source: palantir/tslint

Bug Report

  • __TSLint version__: 5.10.0
  • __TypeScript version__: 2.7.2
  • __Running TSLint via__: (pick one) CLI

With [email protected] everything was fine.

TypeScript code being linted

Whole application

Actual behavior

with tslint 5.10.0

$ tslint --project src/tsconfig.app.json
A LOT more errors are skipped for readability

TypeError: Cannot read property 'kind' of undefined
    at isString (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/noStringThrowRule.js:66:18)
    at cb (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/noStringThrowRule.js:55:17)
    at visitNodes (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13486:24)
    at cb (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/noStringThrowRule.js:62:19)
    at visitNode (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13484:21)
    at cb (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/noStringThrowRule.js:62:19)
    at visitNodes (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13479:24)
The 'callable-types' rule threw an error in '/Users/fancyUsersName/Projects/customer/application/src/app/shared/services/message.service.ts':
TypeError: Cannot read property 'length' of undefined
    at cb (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/callableTypesRule.js:52:29)
    at visitNode (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13328:21)
    at cb (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/callableTypesRule.js:64:19)
    at visitNodes (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13552:21)
    at cb (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/callableTypesRule.js:64:19)
    at visitNodes (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13479:24)
    at walk (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/callableTypesRule.js:50:15)
The 'curly' rule threw an error in '/Users/fancyUsersName/Projects/customer/application/src/app/shared/services/message.service.ts':
TypeError: Cannot read property 'pos' of undefined
    at CurlyWalker.checkStatement (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/curlyRule.js:126:72)
    at cb (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/curlyRule.js:112:23)
    at visitNodes (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13477:24)
    at cb (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/curlyRule.js:120:23)
    at visitNode (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13384:21)
    at cb (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/curlyRule.js:120:23)
    at visitNodes (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13552:21)
The 'deprecation' rule threw an error in '/Users/fancyUsersName/Projects/customer/application/src/app/shared/services/message.service.ts':
Error: Debug Failure. Branch in 'resolveSignature' should be unreachable.
    at resolveSignature (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:40365:22)
    at getResolvedSignature (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:40385:26)
    at Object.getResolvedSignature (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:24568:34)
    at getDeprecation (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/deprecationRule.js:123:49)
    at cb (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/deprecationRule.js:55:35)
    at visitNode (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13438:21)
    at cb (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/deprecationRule.js:69:23)
    at visitNode (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13440:24)
The 'no-arg' rule threw an error in '/Users/fancyUsersName/Projects/customer/application/src/app/shared/services/message.service.ts':
TypeError: Cannot read property 'text' of undefined
    at cb (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/noArgRule.js:50:23)
    at visitNode (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13342:21)
    at cb (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/noArgRule.js:54:19)
    at visitNodes (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13421:24)
    at cb (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/noArgRule.js:54:19)
    at visitNode (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/Users/fancyUsersName/Projects/customer/application/node_modules/typescript/lib/typescript.js:13459:21)
    at cb (/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/noArgRule.js:54:19)

<--- Last few GCs --->

[43608:0x103001e00]     8525 ms: Mark-sweep 697.0 (739.5) -> 696.9 (739.5) MB, 265.7 / 0.0 ms  allocation failure GC in old space requested
[43608:0x103001e00]     8807 ms: Mark-sweep 696.9 (739.5) -> 696.9 (707.0) MB, 281.2 / 0.0 ms  last resort GC in old space requested
[43608:0x103001e00]     9080 ms: Mark-sweep 696.9 (707.0) -> 696.9 (706.0) MB, 273.4 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0xcc3a28254d9 <JSObject>
    1: _loop_1(aka _loop_1) [/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/noShadowedVariableRule.js:~275] [pc=0x26ea30a3eed](this=0xcc3129022d1 <undefined>,identifier=0xcc3fd4250e1 <IdentifierObject map = 0xcc31025e199>)
    2: /* anonymous */(aka /* anonymous */) [/Users/fancyUsersName/Projects/customer/application/node_modules/tslint/lib/rules/noShadowedVariableRu...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Users/fancyUsersName/.nvm/versions/node/v9.5.0/bin/node]
 2: node::OnFatalError(char const*, char const*) [/Users/fancyUsersName/.nvm/versions/node/v9.5.0/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/Users/fancyUsersName/.nvm/versions/node/v9.5.0/bin/node]
 4: v8::internal::Factory::NewUninitializedFixedArray(int) [/Users/fancyUsersName/.nvm/versions/node/v9.5.0/bin/node]
 5: v8::internal::(anonymous namespace)::ElementsAccessorBase<v8::internal::(anonymous namespace)::FastPackedObjectElementsAccessor, v8::internal::(anonymous namespace)::ElementsKindTraits<(v8::internal::ElementsKind)2> >::GrowCapacity(v8::internal::Handle<v8::internal::JSObject>, unsigned int) [/Users/fancyUsersName/.nvm/versions/node/v9.5.0/bin/node]
 6: v8::internal::Runtime_GrowArrayElements(int, v8::internal::Object**, v8::internal::Isolate*) [/Users/fancyUsersName/.nvm/versions/node/v9.5.0/bin/node]
 7: 0x26ea2b842fd
 8: 0x26ea30a3eed
error Command failed with signal "SIGABRT".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

When setting "no-shadowed-variable": true, to "no-shadowed-variable": false,


A LOT more errors are skipped for readability

TypeError: Cannot read property 'kind' of undefined
    at isString (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/tslint/lib/rules/noStringThrowRule.js:66:18)
    at cb (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/tslint/lib/rules/noStringThrowRule.js:55:17)
    at visitNodes (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/typescript/lib/typescript.js:13486:24)
    at cb (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/tslint/lib/rules/noStringThrowRule.js:62:19)
    at visitNode (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/typescript/lib/typescript.js:13484:21)
    at cb (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/tslint/lib/rules/noStringThrowRule.js:62:19)
    at visitNodes (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/typescript/lib/typescript.js:13479:24)
The 'no-string-throw' rule threw an error in '/Users/fancyUsersName/Projects/rojects/customer/application/src/environments/environment.prod.ts':
TypeError: Cannot read property 'kind' of undefined
    at isString (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/tslint/lib/rules/noStringThrowRule.js:66:18)
    at cb (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/tslint/lib/rules/noStringThrowRule.js:55:17)
    at visitNodes (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/typescript/lib/typescript.js:13486:24)
    at cb (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/tslint/lib/rules/noStringThrowRule.js:62:19)
    at visitNode (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/typescript/lib/typescript.js:13484:21)
    at cb (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/tslint/lib/rules/noStringThrowRule.js:62:19)
    at visitNodes (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/Users/fancyUsersName/Projects/rojects/customer/application/node_modules/typescript/lib/typescript.js:13479:24)

ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/app.module.ts[24, 11]: missing whitespace
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kitchensink/kitchensink.component.mock.ts[1, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/components/kontingent-manage/kontingent-verkehrsspiegel-kalender.component.ts[23, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/kontingent-abrechnungsreport.component.ts[47, 14]: Identifier 'i' is never reassigned; use 'const' instead of 'let'.
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/kontingent-manage.component.ts[32, 12]: missing whitespace
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/kontingent-template.component.ts[14, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/kontingent-template.component.ts[35, 12]: missing whitespace
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/model/kontingent-template.model.ts[13, 13]: missing whitespace
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/model/kontingent-template.model.ts[53, 13]: missing whitespace
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/model/selektion-range.model.ts[3, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/services/baureihen.service.ts[4, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/services/kontingent.service.status-representation.ts[1, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/services/kontingent.service.status-representation.ts[10, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/services/kontingent.service.status-representation.ts[16, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/services/kontingent.service.status-representation.ts[24, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/services/kontingent.service.status-representation.ts[29, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/services/kontingent.service.status-representation.ts[36, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/shared/components/display/zeitraum.model.ts[10, 13]: missing whitespace
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/shared/components/input/sitzplatz/sitzplatz-converter.directive.ts[24, 13]: missing whitespace
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/shared/directives/dynamic-component-loader-host.directive.ts[3, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/shared/enums/http-actions.enum.ts[1, 13]: Class name must be in pascal case
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/shared/models/bahnhof.ts[11, 13]: missing whitespace
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/shared/models/fahrplanperiode.model.ts[22, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/shared/models/fahrplanperiode.model.ts[29, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/shared/models/fahrplanperiode.model.ts[36, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/shared/services/converter.service.ts[40, 13]: missing whitespace
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/shared/services/message.service.ts[14, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/hmr.ts[5, 7]: Identifier 'ngModule' is never reassigned; use 'const' instead of 'let'.
WARNING: /Users/fancyUsersName/Projects/rojects/customer/application/src/hmr.ts[9, 54]: get is deprecated: from v4.0.0 use Type<T> or InjectionToken<T>
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/main.util.ts[13, 13]: missing whitespace
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/main.util.ts[44, 11]: missing whitespace
WARNING: /Users/fancyUsersName/Projects/rojects/customer/application/src/main.util.ts[91, 48]: get is deprecated: from v4.0.0 use Type<T> or InjectionToken<T>
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/main.util.ts[118, 13]: missing whitespace
ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/main.util.ts[128, 11]: missing whitespace

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

And even my IDE (intellij) shows these weird errors
As for example

ERROR: /Users/fancyUsersName/Projects/rojects/customer/application/src/app/kontingent/model/selektion-range.model.ts[3, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead

bildschirmfoto 2018-06-05 um 14 40 42

Expected behavior

with tslint 5.9.1

$ tslint --project src/tsconfig.app.json
✨  Done in 5.77s.

my tslint.json

{
  "rulesDirectory": [
    "node_modules/codelyzer",
    "node_modules/rxjs-tslint"
  ],
  "rules": {
    "arrow-return-shorthand": true,
    "callable-types": true,
    "class-name": true,
    "comment-format": [
      true,
      "check-space"
    ],
    "curly": true,
    "deprecation": {
      "severity": "warn"
    },
    "eofline": true,
    "forin": true,
    "import-blacklist": [
      true
    ],
    "import-spacing": true,
    "indent": [
      true,
      "spaces"
    ],
    "interface-over-type-literal": true,
    "label-position": true,
    "max-line-length": [
      true,
      {
        "limit": 130,
        "ignore-pattern": "^import |^export {(.*?)}"
      }
    ],
    "member-access": false,
    "member-ordering": [
      true,
      {
        "order": [
          "static-field",
          "instance-field",
          "static-method",
          "instance-method"
        ]
      }
    ],
    "no-arg": true,
    "no-bitwise": true,
    "no-console": [
      true,
      "debug",
      "info",
      "time",
      "timeEnd",
      "trace"
    ],
    "no-construct": true,
    "no-debugger": true,
    "no-duplicate-super": true,
    "no-empty": false,
    "no-empty-interface": true,
    "no-eval": true,
    "no-inferrable-types": [
      true,
      "ignore-params"
    ],
    "no-misused-new": true,
    "no-non-null-assertion": true,
    "no-shadowed-variable": true,
    "no-string-literal": false,
    "no-string-throw": true,
    "no-switch-case-fall-through": true,
    "no-trailing-whitespace": true,
    "no-unnecessary-initializer": true,
    "no-unused-expression": true,
    "no-unused-variable": true,
    "no-use-before-declare": true,
    "no-var-keyword": true,
    "object-literal-sort-keys": false,
    "one-line": [
      true,
      "check-open-brace",
      "check-catch",
      "check-else",
      "check-whitespace"
    ],
    "prefer-const": true,
    "quotemark": [
      true,
      "single"
    ],
    "radix": true,
    "semicolon": [
      true,
      "always",
      "ignore-bound-class-methods"
    ],
    "triple-equals": [
      true,
      "allow-null-check"
    ],
    "typedef-whitespace": [
      true,
      {
        "call-signature": "nospace",
        "index-signature": "nospace",
        "parameter": "nospace",
        "property-declaration": "nospace",
        "variable-declaration": "nospace"
      }
    ],
    "unified-signatures": true,
    "variable-name": false,
    "whitespace": [
      true,
      "check-branch",
      "check-decl",
      "check-operator",
      "check-separator",
      "check-type"
    ],
    "directive-selector": [
      true,
      "attribute",
      "sima",
      "camelCase"
    ],
    "component-selector": [
      true,
      "element",
      "sima",
      "kebab-case"
    ],
    "no-output-on-prefix": true,
    "use-input-property-decorator": true,
    "use-output-property-decorator": true,
    "use-host-property-decorator": true,
    "no-input-rename": true,
    "no-output-rename": true,
    "use-life-cycle-interface": true,
    "use-pipe-transform-interface": true,
    "component-class-suffix": true,
    "directive-class-suffix": true,
    "rxjs-collapse-imports": true,
    "rxjs-pipeable-operators-only": true,
    "rxjs-no-static-observable-methods": true,
    "rxjs-proper-imports": true

  }
}

Needs More Info Bug

Most helpful comment

Same weird behaviour here, reverting to 5.9.1 is OK.

^C⏎                                                                                                       jmbarbier@pcdevjm /data/devel/packages/bsadmincomponents> npx ng lint  bsadmincomponents --fix
The 'callable-types' rule threw an error in '/data/devel/packages/bsadmincomponents/projects/bsadmincomponents/src/lib/bsac-apiconstants/bsac-api-constants.service.ts':
TypeError: Cannot read property 'length' of undefined
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/callableTypesRule.js:52:29)
    at visitNode (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13565:21)
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/callableTypesRule.js:64:19)
    at visitNodes (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13479:24)
    at walk (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/callableTypesRule.js:50:15)
    at Rule.AbstractRule.applyWithFunction (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/language/rule/abstractRule.js:39:9)
    at Rule.apply (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/callableTypesRule.js:33:21)
    at Linter.applyRule (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/linter.js:197:29)
The 'curly' rule threw an error in '/data/devel/packages/bsadmincomponents/projects/bsadmincomponents/src/lib/bsac-apiconstants/bsac-api-constants.service.ts':
TypeError: Cannot read property 'pos' of undefined
    at CurlyWalker.checkStatement (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/curlyRule.js:126:72)
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/curlyRule.js:112:23)
    at visitNodes (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13477:24)
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/curlyRule.js:120:23)
    at visitNode (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13384:21)
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/curlyRule.js:120:23)
    at visitNode (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13459:21)
The 'no-arg' rule threw an error in '/data/devel/packages/bsadmincomponents/projects/bsadmincomponents/src/lib/bsac-apiconstants/bsac-api-constants.service.ts':
TypeError: Cannot read property 'text' of undefined
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/noArgRule.js:50:23)
    at visitNode (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13349:21)
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/noArgRule.js:54:19)
    at visitNodes (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13486:24)
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/noArgRule.js:54:19)
    at visitNode (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13484:21)
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/noArgRule.js:54:19)

<--- Last few GCs --->

[8901:0x4183290]    11222 ms: Mark-sweep 718.9 (766.3) -> 718.9 (766.3) MB, 370.4 / 0.0 ms  allocation failure GC in old space requested
[8901:0x4183290]    11615 ms: Mark-sweep 718.9 (766.3) -> 718.8 (729.8) MB, 393.1 / 0.0 ms  last resort GC in old space requested
[8901:0x4183290]    11984 ms: Mark-sweep 718.8 (729.8) -> 718.8 (729.8) MB, 368.8 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x256671725501 <JSObject>
    1: _loop_1(aka _loop_1) [/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/noShadowedVariableRule.js:~275] [pc=0x1ddf53a92915](this=0x51ddb2822d1 <undefined>,identifier=0x175f761dfdd1 <IdentifierObject map = 0x1582e8933b61>)
    2: /* anonymous */(aka /* anonymous */) [/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/noShadowedVariableRule.js:~273] [pc=...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [ng]
 2: 0x11f155c [ng]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [ng]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [ng]
 5: v8::internal::Factory::NewUninitializedFixedArray(int) [ng]
 6: 0xdf2313 [ng]
 7: v8::internal::Runtime_GrowArrayElements(int, v8::internal::Object**, v8::internal::Isolate*) [ng]
 8: 0x1ddf535042fd
fish: Tâche 1049872672, 'npx ng lint  bsadmincomponents…' terminée par le signal SIGABRT (Abandon)

tslint.json is angular cli default tslint.json + rxjs-tslint

All 11 comments

Same weird behaviour here, reverting to 5.9.1 is OK.

^C⏎                                                                                                       jmbarbier@pcdevjm /data/devel/packages/bsadmincomponents> npx ng lint  bsadmincomponents --fix
The 'callable-types' rule threw an error in '/data/devel/packages/bsadmincomponents/projects/bsadmincomponents/src/lib/bsac-apiconstants/bsac-api-constants.service.ts':
TypeError: Cannot read property 'length' of undefined
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/callableTypesRule.js:52:29)
    at visitNode (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13565:21)
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/callableTypesRule.js:64:19)
    at visitNodes (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13479:24)
    at walk (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/callableTypesRule.js:50:15)
    at Rule.AbstractRule.applyWithFunction (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/language/rule/abstractRule.js:39:9)
    at Rule.apply (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/callableTypesRule.js:33:21)
    at Linter.applyRule (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/linter.js:197:29)
The 'curly' rule threw an error in '/data/devel/packages/bsadmincomponents/projects/bsadmincomponents/src/lib/bsac-apiconstants/bsac-api-constants.service.ts':
TypeError: Cannot read property 'pos' of undefined
    at CurlyWalker.checkStatement (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/curlyRule.js:126:72)
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/curlyRule.js:112:23)
    at visitNodes (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13477:24)
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/curlyRule.js:120:23)
    at visitNode (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13384:21)
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/curlyRule.js:120:23)
    at visitNode (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13459:21)
The 'no-arg' rule threw an error in '/data/devel/packages/bsadmincomponents/projects/bsadmincomponents/src/lib/bsac-apiconstants/bsac-api-constants.service.ts':
TypeError: Cannot read property 'text' of undefined
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/noArgRule.js:50:23)
    at visitNode (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13349:21)
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/noArgRule.js:54:19)
    at visitNodes (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13272:30)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13486:24)
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/noArgRule.js:54:19)
    at visitNode (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13263:24)
    at Object.forEachChild (/data/devel/packages/bsadmincomponents/node_modules/typescript/lib/typescript.js:13484:21)
    at cb (/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/noArgRule.js:54:19)

<--- Last few GCs --->

[8901:0x4183290]    11222 ms: Mark-sweep 718.9 (766.3) -> 718.9 (766.3) MB, 370.4 / 0.0 ms  allocation failure GC in old space requested
[8901:0x4183290]    11615 ms: Mark-sweep 718.9 (766.3) -> 718.8 (729.8) MB, 393.1 / 0.0 ms  last resort GC in old space requested
[8901:0x4183290]    11984 ms: Mark-sweep 718.8 (729.8) -> 718.8 (729.8) MB, 368.8 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x256671725501 <JSObject>
    1: _loop_1(aka _loop_1) [/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/noShadowedVariableRule.js:~275] [pc=0x1ddf53a92915](this=0x51ddb2822d1 <undefined>,identifier=0x175f761dfdd1 <IdentifierObject map = 0x1582e8933b61>)
    2: /* anonymous */(aka /* anonymous */) [/data/devel/packages/bsadmincomponents/node_modules/tslint/lib/rules/noShadowedVariableRule.js:~273] [pc=...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [ng]
 2: 0x11f155c [ng]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [ng]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [ng]
 5: v8::internal::Factory::NewUninitializedFixedArray(int) [ng]
 6: 0xdf2313 [ng]
 7: v8::internal::Runtime_GrowArrayElements(int, v8::internal::Object**, v8::internal::Isolate*) [ng]
 8: 0x1ddf535042fd
fish: Tâche 1049872672, 'npx ng lint  bsadmincomponents…' terminée par le signal SIGABRT (Abandon)

tslint.json is angular cli default tslint.json + rxjs-tslint

@marcojahn @jmbarbier does this still repro with 5.11?

Sry for the late response.

With 5.11 it is working. 1-2s slower than 5.9.1 but I think this is due more rules etc.

$ yarn scripts:v2:lint:app
yarn run v1.7.0
$ tslint --project src/tsconfig.app.json
✨  Done in 7.50s.

I'd guess so. Gonna close this out. If it becomes an issue again, feel free to reopen this or file a new issue.

I'm still seeing this with 5.11.0 (on macOS if that matters)

Likewise, downgrading to 5.9.1 solves the issue for me.

Anyone resolve it?

FYI, this bug is not the fault of tslint but rather how your dependency tree resolves typescript. There can end up being multiple versions of TypeScript in your dependency tree, where one is generating an AST and the other is trying to read it, but is incompatible. In my particular case, I had _two_ 2.x versions of tsutils floating around that ultimately caused multiple TypeScript dependencies. After consolidating those tsutils to resolve to the latest 2.x (2.29.0) in my yarn.lock, I am no longer getting these errors.

FYI, this bug is not the fault of tslint but rather how your dependency tree resolves typescript. There can end up being multiple versions of TypeScript in your dependency tree, where one is generating an AST and the other is trying to read it, but is incompatible. In my particular case, I had _two_ 2.x versions of tsutils floating around that ultimately caused multiple TypeScript dependencies. After consolidating those tsutils to resolve to the latest 2.x (2.29.0) in my yarn.lock, I am no longer getting these errors.

hi Appden,
I have this issue after updating my angular to version 7, my tslint is version 5.12, I have tried downgrading to tslint version 5.9 but the errors did not go away. I want to try out your suggestion of consolidating tsutils but I really have no idea about how to do this, are you suggesting modifying yarn.lock manually? if so could you please explain in more detail exactly what to look for and what to change?

@pchandra2000 It's been awhile since I thought about this issue, but yes, in a case like this I will manually remove certain dependencies from yarn.lock then re-run yarn so it will re-resolve to the latest dependencies. There are other ways to trick it into doing what you want, but that is usually the simplest for me.

@appden thank you for your response. I however got to the bottom of it myself. It turns out that I had installed rxjs-tslint as well as tslint locally on my project, this is what resulted in conflict and gave me 100's of linting errors. I simply removed rxjs-tslint from my local package.json and installed it globally and left tslint as is, the errors disappeared.

Was this page helpful?
0 / 5 - 0 ratings