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

Provide `parserServices` when using `@typescript-eslint/parser` #665

Open Yash-Singh1 opened 2 years ago

Yash-Singh1 commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

When I am trying to use the parserServices to make a typed rule in typescript eslint, the parserServices is undefined

To Reproduce Steps to reproduce the behavior:

  1. Go to the ast explorer
  2. Select the parser as typescript eslint
  3. Try to access parser services
  4. Notice it is not filled

Expected behavior A clear and concise description of what you expected to happen.

parserServices are provided

Screenshots If applicable, add screenshots to help explain your problem.

Browser (please complete the following information):

astexplorer settings:

Additional context Add any other context about the problem here.

The problem is related to setting parseroptions.object, as seen here

https://github.com/typescript-eslint/typescript-eslint/blob/830b9463fc80ee3deba435f273e73fa6339564e7/packages/utils/src/eslint-utils/getParserServices.ts#L5

DerekRies commented 2 years ago

I don't think this is a bug, but more of a feature request to include an actual @typescript-eslint transform. Afaik there's only the @typescript-eslint/parser and an ESLint transform. The parserServices stuff is included with @typescript-eslint/utils, not the parser, nor the base eslint package.

Adding that would make this an exceptionally powerful tool though.