feat: TypeScript support for Espree#705
Conversation
72bc186 to
7564529
Compare
|
Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update. |
|
Not stale. This PR needs to be reviewed. |
|
@brettz9 thanks for this. We're in the middle of preparing to release the first prerelease of v10, so we're a bit swamped at the moment. We'll get around to reviewing this once our schedules free up a bit. |
|
Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update. |
|
I think this is a very good approach to autogenerating the types. We could adopt some of these techniques in other repositories to simplify complexity. |
Great... If you end up using this approach, I have a branch ready for eslint-scope as well (though it looks like you might already be working on one, sorry!). |
We can definitely look into autogenerating types for |
fasttime
left a comment
There was a problem hiding this comment.
Since espree types are a new feature, what do you think about adding tests for it? We already have type tests for eslint-visitor-keys in packages/eslint-visitor-keys/test-d/index.test-d.ts and we could add similar tests for espree as well. DefinitelyTyped also has type tests for @types/espree which could be a useful reference, if we want to build on their work.
Sure.
That was a helpful pattern to follow. I've added a1d2f7a which adds their tests as well as 138f496 which adds the public exports they were missing. Let me know if you think we need coverage for other types (and which ones). |
I think that's good enough for a start. |
Co-authored-by: 루밀LuMir <rpfos@naver.com>
Co-authored-by: 루밀LuMir <rpfos@naver.com>
Co-authored-by: 루밀LuMir <rpfos@naver.com>
Co-authored-by: 루밀LuMir <rpfos@naver.com>
Co-authored-by: 루밀LuMir <rpfos@naver.com>
Co-authored-by: 루밀LuMir <rpfos@naver.com>
Co-authored-by: 루밀LuMir <rpfos@naver.com>
Co-authored-by: Francesco Trotta <github@fasttime.org>
Prerequisites checklist
What is the purpose of this pull request?
Provide TypeScript support for
espree.What changes did you make? (Give an overview)
checkJs/allowJsTypeScript toespree.lib/espree.js, removes an uncovered and apparently unnecessary branch (previously lines 152-154) where a property was being added to an array.Related Issues
A renewed approach to #544 which doesn't require a special, fragile build routine or non-standard JSDoc tags.
Is there anything you'd like reviewers to focus on?
The
@typedefexports that were of previous concern should not be here since the main file does not use them except for public type exports. Otherwise, we are using@import.Has some added complexity in redefining Acorn/acorn-jsx because Acorn's TypeScript does not concern all properties of relevance to plugin authors. See acornjs/acorn#1404 .
Currently applies acorn-jsx from my own fork as waiting on acornjs/acorn-jsx#139 .