fkling / fkling/astexplorer

Object node type inconsistency with babylon7 and jscodeshift

Open
#333 2 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
JavaScript
Stars
6.5k
Forks
772
PR merge metrics
No merged PRs in 30d

Description

When running with
Parser: `babylon7-7.0.0-beta.44`
Transformer: `jscodeshift-0.5.0`
There is some inconsistency between what is shown in the `tree` view and in the `jscodeshift` output, the `ObjectProperty` shown in the tree is `Property` in `jscodeshift`, which is a bit confusing (see screenshot).

I believe this is because `jscodeshift` is using babel by default (which uses `Property`). Adding `export const parser = 'babylon';` before my transform or `const j = api.jscodeshift.withParser('babylon');` at the start of my transform works but doesn't change the autocomplete suggestions from the babel versions (ie `j.Property` still gets suggested over `j.ObjectProperty`).

Is there any way to fix the autocomplete issue here? Also since `jscodeshift` takes a parser, would it make sense to pass it whatever parser AST Exporer is using to avoid this confusion?

Thanks for all the great work on AST Explorer 🙌!

screen shot 2018-07-22 at 10 10 03 am

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.