Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Incompatible with typescript 2.7 #3711

Closed
dbrockman opened this issue Feb 12, 2018 · 12 comments
Closed

Incompatible with typescript 2.7 #3711

dbrockman opened this issue Feb 12, 2018 · 12 comments

Comments

@dbrockman
Copy link

Bug Report

  • TSLint version: 5.9.1
  • TypeScript version: 2.7.1
  • Running TSLint via: CLI

I'm getting a lot of errors thrown from within tslint when using tslint with typescript 2.7.1

Here's an abbreviated list of errors with the first location in the stack trace:

  • TypeError: Cannot read property 'declarations' of undefined at cb (node_modules/tslint/lib/rules/oneVariablePerDeclarationRule.js:57:73)
  • TypeError: Cannot read property 'kind' of undefined at cb (node_modules/tslint/lib/rules/noSparseArraysRule.js:50:70)
  • TypeError: Cannot read property 'kind' of undefined at cb (node_modules/tslint/lib/rules/noUnusedExpressionRule.js:109:75)
  • TypeError: Cannot read property 'kind' of undefined at cb (node_modules/tslint/lib/rules/objectLiteralShorthandRule.js:69:27)
  • TypeError: Cannot read property 'kind' of undefined at cb (node_modules/tslint/lib/rules/preferConstRule.js:163:98)
  • TypeError: Cannot read property 'kind' of undefined at cb (node_modules/tslint/lib/rules/tripleEqualsRule.js:67:37)
  • TypeError: Cannot read property 'kind' of undefined at isPlusExpression (node_modules/tslint/lib/rules/preferTemplateRule.js:112:69)
  • TypeError: Cannot read property 'length' of undefined at cb (node_modules/tslint/lib/rules/noDuplicateVariableRule.js:79:66)
  • TypeError: Cannot read property 'length' of undefined at cb (node_modules/tslint/lib/rules/noSparseArraysRule.js:59:54)
  • TypeError: Cannot read property 'length' of undefined at Object.mapDefined (node_modules/tslint/lib/utils.js:159:55)

It seems to me like some of the typescript AST nodes no longer has properties that tslint is using.

@mhegazy
Copy link

mhegazy commented Mar 1, 2018

@andy-ms any idea what is going on?

@dbrockman
Copy link
Author

If it helps, this is no longer a problem (for me) with TypeScript version 2.7.2.
Maybe it was a bug in 2.7.1?

@M-Zuber
Copy link

M-Zuber commented Mar 7, 2018

I am also on 2.7.2 and everything looks fine as well

@vire
Copy link

vire commented Mar 18, 2018

Same problem

OSX: 10.13.3 (17D102)
yarn: 1.5.1,
tslint: 5.9.1, 
typescript: 2.7.2

@ghost
Copy link

ghost commented Mar 19, 2018

@vire Try using npm and installing tslint@latest and typescript@next. The vscode error only happened when using yarn too.

@vire
Copy link

vire commented Mar 20, 2018

After installing latest react-scripts-ts the problem disappeared for now - I suspect their dependencies were somehow incorrect :/

Also worth to mention the issue was present also in the CLI not just vscode

@edevine
Copy link

edevine commented Apr 7, 2018

I experience this with
yarn 1.5.1
tslint: 5.9.1,
typescript: 2.7.2

Downgrading to yarn 1.3.2 resolved the issue.

huy-nguyen added a commit to huy-nguyen/remark-github-plugin that referenced this issue Apr 29, 2018
Build https://circleci.com/gh/huy-nguyen/remark-github-plugin/72 failed
probably because of this conflict between yarn and tslint
(palantir/tslint#3711). The suggested solution
there is to not use yarn but I wan to keep using yarn. Restoring tslint
to 5.8.0 seems to fix the problem.
@smoke
Copy link

smoke commented May 16, 2018

When upgrading to Angular 6 I have accidentally left rxjs-tslint in the devDependencies which pulled typescript@^2.8.0 which caused this same issue.

As a workaround - make sure that nothing is pulling different versions of typescript.

@johnwiseheart
Copy link
Contributor

I believe this has been fixed.

@giladgray
Copy link

giladgray commented Jul 31, 2018

image
(from latest master build)

@cvgaviao
Copy link

@smoke, can I ask you how to do to know if there are any dependency pulling typescript@^8.2.0 ?

@smoke
Copy link

smoke commented Aug 17, 2018

@cvgavio look at package-lock.json or yarn.lock - if you see different versions of typescript installed there will be at least 2 records.

... and I did typo in my comment, the version is ^2.8.0 if that matters.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants