Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

New: parseForESLint method and parser services #94

Closed
wants to merge 1 commit into from

Conversation

JamesHenry
Copy link
Member

Here is the source for the restrict-plus-operands rule I was able to create in eslint-plugin-typescript when using this feature branch and the branch from this ESLint PR eslint/eslint#6975:

unspecified-7

It will be very hard to predict / hard to maintain exactly which TypeScript helpers will be useful in plugins rules, so for now I have exposed the full TypeScript API via ts.

@nzakas
Copy link
Member

nzakas commented Sep 23, 2016

I'm just holding off on reviewing until I land the corresponding functionality in ESLint, just in case something changes.

@JamesHenry
Copy link
Member Author

eslint/eslint#6975 was merged so this should now be ready for review :)

var converted = astConverter(typescriptData.ast, extra);
return {
ast: converted.ast,
services: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make sure we've thought this interface through completely. Are you sure about all of these?

Is ts the right name to expose? (Will people know what it is?)

Is "program" the correct name? Or should it be "TSProgram" (can't remember if that's a node or something else)

In any case, it seems like this interface should be documented in the README.

@JamesHenry
Copy link
Member Author

JamesHenry commented Oct 22, 2016

Thanks, @nzakas! I'll loop back round to this once TS 2 support is complete :)

@JamesHenry
Copy link
Member Author

Closing for now, as there is no direct action item off the back of it, and there are more pressing tasks.

Will pick this up again soon when building out more complex rules in the plugin

@JamesHenry JamesHenry closed this Jan 14, 2017
@j-f1
Copy link
Contributor

j-f1 commented Dec 8, 2017

I’d like to see this feature happen — I’m writing a custom rule that uses type information, and this would make that rule possible much more useful. (xref desktop/desktop#3550)

@JamesHenry
Copy link
Member Author

We've been working on improved parser integrations in general in ESLint: eslint/eslint#8755

This will land soon and then we can start building things out on the typescript-eslint-parser side

@JamesHenry JamesHenry deleted the parser-services branch September 25, 2018 13:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants