Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Docs: Add rich code snippets (or links to them) to AST spec docs #9671

Open
Labels
accepting prsGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updatingpackage: websiteIssues related to the @typescript-eslint website
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Before You File a Documentation Request Please Confirm You Have Done The Following...

Suggested Changes

Quoting@paulius-valiunas's#2726 (comment):

It's nice to finally have online documentation for the properties of each interface, but it's still difficult to map an interface to a code snippet, which was the primary concern of this issue. As in the example I originally wrote in the issue description,TSTypeParameterInstantiation still doesn't provide any information about how to recognize this AST node in code. If a developer wants to be efficient at working with the AST (e.g. writing ESLint rules), they have to be able to:

  1. Upon seeing a code snippet, understand what AST nodes it comprises. This can currently be done with the help ofhttps://astexplorer.net/
  2. Upon encountering an AST type, visualize it as a code snippet in their mind.

Both can be done with the help of a debugger, or simply "printf-debugging", but that significantly slows down any development effort until the developer memorizes the bigger part of the AST types after applying them in practice multiple times. Having some reference material to help deal with problem no.1 would be tremendously helpful. As per@bradzacher's suggestion, I'm able to search through this repo and finda snapshot containing the type I need and then map it tothe corresponding snippet, but unfortunately that is a time-consuming process and it would be much more helpful to have each interface in the documentation (or at least some of them) link to a minimal example snippet.

Agreed, it'd be nice to have...something like that in the docs.

Affected URL(s)

https://typescript-eslint.io/packages/typescript-estree/ast-spec

💖

Co-authored-by:@paulius-valiunas

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updatingpackage: websiteIssues related to the @typescript-eslint website

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp