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 Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Relevant Package
parser
Playground Link
Repro Code
classC{"constructor"(){}}
ESLint Config
n/a
tsconfig
n/a
Expected Result
I expectedkey
property ofMethodDefinition
to be aLiteral
, not anIdentifier
.
This would match Espree (AST explorer).
Actual Result
key
property ofMethodDefinition
is anIdentifier
:
{"type":"MethodDefinition","key": {"type":"Identifier","range": [12,25],"name":"constructor","decorators": [],"optional":false,"typeAnnotation":null },"kind":"constructor","...":"..."}
Main reason I think this is a bug is that it's different from Espree, wherekey
is aLiteral
.
But additionally, I feel this is error-prone, because you can normally assume that the section of source text corresponding to anIdentifier
's range starts with either aUnicodeIDStart character, or\
. This breaks that rule - the first character is"
.
Additional Info
No response
Versions
package | version |
---|---|
@typescript-eslint/parser | 8.30.1 |