benjamn / benjamn/recast

recast.parse returns any

Open
#692 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.3k
Forks
363
Avg merge
3d 8h
Merged PRs (30d)
3

Description

I'd like to use this library via Typescript but the top-level [parse](https://github.com/benjamn/recast/blob/master/lib/parser.ts#L124) function [returns any](https://github.com/benjamn/recast/blob/master/lib/parser.ts#L134), meaning I need to do at least one cast to start using the type system. What is the suggested way of getting typed values out of recast?

Thanks

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the top-level parse function in lib/parser.ts, especially the linked definition and return type around lines 124 and 134. Investigate how callers are expected to obtain typed values from recast, then verify that the resulting TypeScript API supports use without an initial cast.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.