fkling / astexplorer

A web tool to explore the ASTs generated by various parsers.
https://astexplorer.net/
MIT License
6.14k stars 729 forks source link

Better options in vue-eslint-parser #582

Closed muxishuihan closed 3 years ago

muxishuihan commented 3 years ago

Hi~ In default options, vue-eslint-parser can't deal with "?." and it will cause an"Unexpected token ." error. let arr = res?.data?.list is equals to let arr = res && res.data && res.data.list

It may be better if we add "ecmaVersion": 2020" in the option of vue-eslint-parser(vue-eslint-parser.js) module. Best wishes.

fkling commented 3 years ago

Mmh, it doesn't look like to make a difference. If I set it to 2021 I still get a parser error. But maybe the version and/or dependencies need to be updated.

fkling commented 3 years ago

This should work now. https://github.com/fkling/astexplorer/commit/4a903b476ad4cbffa6dff72c9d9a2f4bb944c987