airbnb / ts-migrate

A tool to help migrate JavaScript code quickly and conveniently to TypeScript
MIT License
5.42k stars 219 forks source link

Argument name clash #63

Open tomasbruckner opened 3 years ago

tomasbruckner commented 3 years ago

Sometimes I get

version 0.1.10

[declare-missing-class-properties] Plugin 8 of 13. Start...
Error: [declare-missing-class-properties][build\mainCtrl.ts] Error:
 SyntaxError: Argument name clash (1:81)
    at Object.raise (C:\path\project\node_modules\@babel\parser\lib\index.js:6325:17)
    at Object.checkLVal (C:\path\project\node_modules\@babel\parser\lib\index.js:8010:18)
    at Object.checkLVal (C:\path\project\node_modules\@babel\parser\lib\index.js:5727:15)
    at Object.checkParams (C:\path\project\node_modules\@babel\parser\lib\index.js:9449:12)
    at Object.parseFunctionBody (C:\path\project\node_modules\@babel\parser\lib\index.js:9423:12)
    at Object.parseFunctionBodyAndFinish (C:\path\project\node_modules\@babel\parser\lib\index.js:9394:10)
    at Object.parseFunctionBodyAndFinish (C:\path\project\node_modules\@babel\parser\lib\index.js:5219:11)
    at C:\path\project\node_modules\@babel\parser\lib\index.js:10535:12
    at Object.withTopicForbiddingContext (C:\path\project\node_modules\@babel\parser\lib\index.js:9702:14)
    at Object.parseFunction (C:\path\project\node_modules\@babel\parser\lib\index.js:10534:10) {
  pos: 81,
  loc: Position { line: 1, column: 81 }
}
Error: [declare-missing-class-properties][build\parameters\parametrizationGroup.ts] Error:
 SyntaxError: Argument name clash (3:54)
    at Object.raise (C:\path\project\node_modules\@babel\parser\lib\index.js:6325:17)
    at Object.checkLVal (C:\path\project\node_modules\@babel\parser\lib\index.js:8010:18)
    at Object.checkLVal (C:\path\project\node_modules\@babel\parser\lib\index.js:5727:15)
    at Object.checkParams (C:\path\project\node_modules\@babel\parser\lib\index.js:9449:12)
    at Object.parseFunctionBody (C:\path\project\node_modules\@babel\parser\lib\index.js:9423:12)
    at Object.parseFunctionBodyAndFinish (C:\path\project\node_modules\@babel\parser\lib\index.js:9394:10)
    at Object.parseFunctionBodyAndFinish (C:\path\project\node_modules\@babel\parser\lib\index.js:5219:11)
    at C:\path\project\node_modules\@babel\parser\lib\index.js:10535:12
    at Object.withTopicForbiddingContext (C:\path\project\node_modules\@babel\parser\lib\index.js:9702:14)
    at Object.parseFunction (C:\path\project\node_modules\@babel\parser\lib\index.js:10534:10) {
  pos: 237,
  loc: Position { line: 3, column: 54 }
}

Hard to tell when this happens or what causes it. Maybe add better logging if it is possible.

edsrzf commented 3 years ago

Are you able to provide some code that reproduces the issue, similar to what you provided in #62? That would be very helpful in solving the issue.