Huy-Anh Hoang
Huy-Anh Hoang

Reputation: 797

ESLint: Parsing Error: Unexpected token ':'

I'm trying to use ESLint with Flow, but when I test it out in my file ESLint doesn't detect that I'm using static types.

var str: number = 'hello world';

What can I install or how can I make my linter ignore this? The colon, specifically.

Upvotes: 3

Views: 5950

Answers (2)

serg06
serg06

Reputation: 2695

You don't need babel, you can just use typescript-eslint.

Upvotes: 1

Wietse Venema
Wietse Venema

Reputation: 2764

Use babel-eslint as parser in .eslintrc:

"parser": "babel-eslint",

Upvotes: 10

Related Questions