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

Bug: ArrowFunctionExpression's generator property should always be false #8140

Closed
Labels
ASTPRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: ast-specIssues related to @typescript-eslint/ast-spec
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

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

Suggested Changes

Coming over from@sosukesuzuki'shttps://discord.com/channels/1026804805894672454/1088474511759917106/1189257356899520512:

  1. When does the generator field become true? ( )
  2. Why does the id field that is always null exist? (

Response from@Josh-Cena:

  1. Never:https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-estree/src/convert.ts#L1553
    So, your two questions are actually one: why do we have useless fields on ArrowFunctionExpression?
    I believe the only reason is because rules often use ArrowFunctionExpression,FunctionDeclaration,FunctionExpression as a selector, and you don't want to prevent people from querying if (func.generator)
    But maybe others who are more familiar with the AST spec can say more

That's my understanding too.

Separately from#2726, let's add JSDoc comments in code? +1 that it's unclear.

Affected URL(s)

n/a (code comments)

Metadata

Metadata

Assignees

No one assigned

    Labels

    ASTPRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: ast-specIssues related to @typescript-eslint/ast-spec

    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