-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
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 issuebugSomething isn't workingSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: typescript-estreeIssues related to @typescript-eslint/typescript-estreeIssues related to @typescript-eslint/typescript-estree
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 have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Relevant Package
parser
Playground Link
Repro Code
class C {
"constructor"() { }
}ESLint Config
n/atsconfig
Expected Result
I expected key property of MethodDefinition to be a Literal, not an Identifier.
This would match Espree (AST explorer).
Actual Result
key property of MethodDefinition is an Identifier:
{
"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, where key is a Literal.
But additionally, I feel this is error-prone, because you can normally assume that the section of source text corresponding to an Identifier's range starts with either a UnicodeIDStart character, or \. This breaks that rule - the first character is ".
Additional Info
No response
Versions
| package | version |
|---|---|
@typescript-eslint/parser |
8.30.1 |
fisker
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 issuebugSomething isn't workingSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: typescript-estreeIssues related to @typescript-eslint/typescript-estreeIssues related to @typescript-eslint/typescript-estree