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: throw an error for invalidTSParameterPropertys #11708

Open
Labels
ASTPRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or requestpackage: ast-specIssues related to @typescript-eslint/ast-specpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree
@bradzacher

Description

@bradzacher

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

classTest1{constructor(private[foo]=[1],private{ bar}={bar:1},private ...baz){}}

Currently these three parameter properties are semantic errors in TS and are similarly allowed by our parser.
However they are all non-sensical. The first twodon't even transpile to generate a property!

We should make these hard errors to block the syntax so that we can refine ourTSParameterProperty.parameter type to exclude the invalid states.

An additional case which is already a hard TS parser error that we should pre-narrow the types for -- the.left of an assignment parameter propertymust always be anIdentifier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ASTPRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or requestpackage: ast-specIssues related to @typescript-eslint/ast-specpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree

    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