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

Misplaced opening brace #935

Closed
Zorgatone opened this issue Jan 25, 2016 · 4 comments
Closed

Misplaced opening brace #935

Zorgatone opened this issue Jan 25, 2016 · 4 comments

Comments

@Zorgatone
Copy link

The following snippets gives me the "Misplaced opening brace" error on tslint version "3.2.2-dev.1".

Is it supposed to be like that? And how do I need to reformat the code to make it happy?

let geoConfig: {
    maximumAge?: number;
    timeout?: number;
    enableHighAccuracy?: boolean;
} = {
    maximumAge: 3000,
    timeout: 5000,
    enableHighAccuracy: false // true might cause some errors
};
@jkillian
Copy link
Contributor

Hey @Zorgatone, thanks for noticing this, seems like a bug. I've filed #937 to fix this. For now, I'd just surround your code with disable/enable flags:

/* tslint:disable:one-line */
...variable declaration here...
/* tslint:enable:one-line */

@jkillian
Copy link
Contributor

The fix for this has merged and should be available in the next release of TSLint (likely about a week).

@Zorgatone
Copy link
Author

Zorgatone commented Jan 25, 2016 via email

@adidahiya
Copy link
Contributor

Fix is now available in v3.4.0-dev.1

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

3 participants