Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Open
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I havesearched for related issues and found none that match my proposal.
- I have searched thecurrent rule list and found no rules that match my proposal.
- I haveread 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
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}