-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
ASTPRs and Issues about the AST structurePRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancementNew feature or requestNew feature or requestpackage: ast-specIssues related to @typescript-eslint/ast-specIssues related to @typescript-eslint/ast-specpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estreeIssues related to @typescript-eslint/typescript-estree
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I have searched for related issues and found none that match my proposal.
- I have searched the current rule list and found no rules that match my proposal.
- I have read the FAQ and my problem is not listed.
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
class Test1 {
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 two don't even transpile to generate a property!
We should make these hard errors to block the syntax so that we can refine our TSParameterProperty.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 property must always be an Identifier.
kirkwaiblinger
Metadata
Metadata
Assignees
Labels
ASTPRs and Issues about the AST structurePRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancementNew feature or requestNew feature or requestpackage: ast-specIssues related to @typescript-eslint/ast-specIssues related to @typescript-eslint/ast-specpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estreeIssues related to @typescript-eslint/typescript-estree