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

Typescript Support #505

Closed
hzoo opened this issue Jul 24, 2017 · 27 comments
Closed

Typescript Support #505

hzoo opened this issue Jul 24, 2017 · 27 comments

Comments

@hzoo
Copy link
Member

hzoo commented Jul 24, 2017

https://github.com/babel/babylon/releases/tag/v7.0.0-beta.16 landed the typescript plugin, so we can already update babel-eslint to support it? Just gotta add it to the list of plugins + any fixes (update to beta.17)

May have to have an option though since can't have run both flow and ts.

means modifying https://github.com/babel/babel-eslint/blob/master/index.js#L396

@kaicataldo
Copy link
Member

I think we should make it an option. Now that ESLint has glob-based configuration, it would allow for projects to have fine-grained control of when they want to enable TypeScript support or not.

@JamesHenry
Copy link
Member

Please can we put this in on pause for now? I am working with Andy to align on AST structure (we are still finding issues in both projects) and it would be confusing to have two different ways to use ESLint with TypeScript whilst we figure that out IMHO

@JamesHenry
Copy link
Member

Happy to chat further on it on babel slack group if it would be useful!

@hzoo
Copy link
Member Author

hzoo commented Jul 25, 2017

sure we can do that, it was more that we should start testing it out ourselves (don't need to broadcast)

@kaicataldo
Copy link
Member

@JamesHenry Thanks for the update :)

@JamesHenry
Copy link
Member

@hzoo Sure, thanks, I guess there is no harm in getting the ball rolling and the important note is just that the AST is definitely still subject to change

@hzoo
Copy link
Member Author

hzoo commented Jul 25, 2017

Yeah, babel-eslint is standalone so we can update when it happens (no plugins, etc)

@hzoo
Copy link
Member Author

hzoo commented Aug 7, 2017

Ok after babel/babylon#658 we can make a better error message

@kaicataldo
Copy link
Member

I think we should also wait for eslint/eslint#8755 to land, so that we can use a real API for TypeScript scope/visitor keys.

@azz
Copy link
Member

azz commented Dec 8, 2017

Went to set this up today and realized this tiny bit is missing. Would it make sense to land a PR to add:

{
  "parser": "babel-eslint",
  "parserOptions": {
    "typescript": true
  }
}

That replaces "flow" with "typescript"?

@nicolo-ribaudo
Copy link
Member

@azz We can use #523

@kaicataldo
Copy link
Member

kaicataldo commented Jan 24, 2018

If you want to use ESLint to lint TypeScript right now, you can use https://github.com/eslint/typescript-eslint-parser. It's still in development, but it's stable enough that I've been using it at work without issue.

@stnwk
Copy link

stnwk commented Mar 27, 2018

Both eslint/eslint#8755 and babel/babylon#658 have been merged :)

@donaldpipowitch
Copy link

Hi everyone. Short question: Is there already an option for this or does the TypeScript support currently depends on #573, so it picks up your correctly configured Babel config? Thanks.

@kaicataldo
Copy link
Member

kaicataldo commented Jun 15, 2018

@JamesHenry How are we feeling about this now? Is it possible to move forward here?

@porfirioribeiro
Copy link

I don't use Flow in my app, it's possible to fork and replace flow with typescript?

@kaicataldo
Copy link
Member

@JamesHenry friendly ping!

@sibelius
Copy link

sibelius commented Sep 5, 2018

this is how we are doing in our codebase at @entria

https://medium.com/entria/incremental-migration-to-typescript-on-a-flowtype-codebase-515f6490d92d

we use flow plugin in all .js files and use ts plugin in all .ts files

does this sound reasonable?

@g-plane
Copy link

g-plane commented Sep 26, 2018

I opened a PR for this. That PR adds a feature that we can customize babel parser plugins. That is, we can enable the typescript plugin (it will automatically disable flow). Also, that feature can disable other plugins.

PR link: #692

@iFwu
Copy link

iFwu commented Oct 12, 2018

It would be great if I can use this parser to lint my ts files.

@rafamel
Copy link

rafamel commented Oct 15, 2018

Hi guys, just wondering what the current state of ts support is for babel-eslint. As per this issue, I'm assuming is it still not implemented? It would be really awesome to see this happening!

@keenwon
Copy link

keenwon commented Nov 16, 2018

Any updated status on this?

@nathanredblur
Copy link

Babel compile well the as operator, why babel-parser or eslint itself not works well with it?

@stnwk
Copy link

stnwk commented Jan 17, 2019

Does anyone have more info about the current state of this? Maybe @hzoo can help?

@kaicataldo
Copy link
Member

Closing this as a dupe of #663.

@wKich
Copy link

wKich commented Jan 18, 2019

@kaicataldo Why you close this issue? By issue id #663 is dupe of this. And you forget about the label.

@krvajal
Copy link

krvajal commented Apr 22, 2019

@kaicataldo IMO #663 is a duplicate of this one, not the other way around.

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.