Skip to content

Documentation for AST node types #2726

@paulius-valiunas

Description

@paulius-valiunas
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

not applicable

Expected Result

not applicable

Actual Result

not applicable

Additional Info

This is a meta issue about documentation.

I couldn't find any information about the AST node types, especially the ones that are Typescript-specific. For example, if I'm extending a rule and I come across a place where it's dealing with TSTypeParameterInstantiation - how do I know what that means? Ideally, it would be great to have a gallery with code snippets (examples) for every available node type. I know that's a great effort, but even starting to add some JSDoc comments with very brief explanations or short snippets to the code would help a lot.

Here's an example of what I'm thinking of:

Before

export interface CallExpression extends CallExpressionBase {
  type: AST_NODE_TYPES.CallExpression;
}

After

/**
 * A function/method call.
 * @example function1<Type1>(arg1);
 */
export interface CallExpression extends CallExpressionBase {
  type: AST_NODE_TYPES.CallExpression;
}

Of course, that's an easy example, everyone knows what a call expression is. But for more complex types, this would make writing rules significantly easier.

Versions

package version
@typescript-eslint/typescript-estree 4.6.0
TypeScript 3.4.3
node 12.19.0

Metadata

Metadata

Assignees

Labels

accepting prsGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updatinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: ast-specIssues related to @typescript-eslint/ast-spec

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy