Closed
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
> parse = require("@typescript-eslint/typescript-estree").parse
[Function: parse]
> ast = parse('class A {a (@d private x: number) {}}')
{
type: 'Program',
body: [
{
type: 'ClassDeclaration',
id: [Object],
body: [Object],
superClass: null
}
],
sourceType: 'script'
}
> ast.body[0].body.body[0].value.params[0].decorators[0]
{ type: 'Decorator', expression: { type: 'Identifier', name: 'd' } }
> ast.body[0].body.body[0].value.params[0].parameter.decorators[0]
{ type: 'Decorator', expression: { type: 'Identifier', name: 'd' } }
ESLint Config
N/A
tsconfig
Expected Result
Not duplicate the decorator
Actual Result
the decorator get duplicate
Additional Info
No response
Versions
package | version |
---|---|
@typescript-eslint/parser |
5.36.1 |
node |
18.8.0 |