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

Enhancement: MovePropertyDefinition.typeAnnotation toPropertyDefinition.key.typeAnnotation? #11321

Open
Labels
enhancementNew feature or requesttriageWaiting for team members to take a look
@fisker

Description

@fisker

Before You File a Proposal Please Confirm You Have Done The Following...

Relevant Package

ast-spec

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

For

classA{foo:number=1}

The:number is onPropertyDefinition.typeAnnotation.

But

constfoo:number=1

The:number is onVariableDeclarator.id.typeAnnotation.

This looks inconsistent to me.

We should usePropertyDefinition.typeAnnotation/VariableDeclarator.typeAnnotation orPropertyDefinition.key.typeAnnotation/VariableDeclarator.id.typeAnnotation.

Additional Info

I found this whiling creating an ESLint rule that inserts a value toPropertyDefinition.

I expect insert= 1 afterPropertyDefinition.key to work, but

class A{-foo:number+foo = 1:number}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageWaiting for team members to take a look

    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