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

whitespace rule is incompatible with typescript <= 2.3.0 #2891

Closed
otaran opened this issue Jun 5, 2017 · 2 comments · Fixed by #2893
Closed

whitespace rule is incompatible with typescript <= 2.3.0 #2891

otaran opened this issue Jun 5, 2017 · 2 comments · Fixed by #2893

Comments

@otaran
Copy link

otaran commented Jun 5, 2017

Bug Report

  • TSLint version: 5.4.2
  • TypeScript version: 2.2.2
  • Running TSLint via: CLI

TypeScript code being linted

const answer=42;

with tslint.json configuration:

{
    "rules": {
        "whitespace": true
    }
}

Actual behavior

const answer=42 is not flagged by tslint, the following warning is reported instead:

Warning: ts.isWhiteSpaceLike is not a function

Expected behavior

const answer=42 should be flagged by tslintwith the following message:

ERROR: test.ts[1,13]: missing whitespace
ERROR: test.ts[1,14]: missing whitespace

Notes

typescript renamed its internal function isWhiteSpace to isWhiteSpaceLike in microsoft/TypeScript@4fa2312 which was released in typescript 2.3.1.

tslint switched to using new name in #2694, but did not provide a fallback code for typescript <= 2.3.0.

5.2.0 is the last working version of tslint.

@ajafff
Copy link
Contributor

ajafff commented Jun 5, 2017

space-before-function-paren is also affected.

I wondered why the tests didn't fail...
Since #2425 we're no longer testing with older versions of typescript (currently only 2.3.3 and next). Is that intended @adidahiya @nchen63?
I think there should be tests with 2.1.x and 2.2.x

@adidahiya
Copy link
Contributor

yeah, looks like that slipped under my radar... I agree that we should be testing with 2.2 and maybe 2.1 (if it's not too inconvenient)

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

Successfully merging a pull request may close this issue.

3 participants