ts.unescapeIdentifier is not a function


(Alex Soh) #1

Hi, i am trying to use sonarlint for my typescript project.After successfully connected to my sonarqube server, i found this error in the logfile while trying to scan my code files. No linting or coverage report was then produced.

[Info  - 12:02:57 PM] 1 files indexed
'PHP sensor' skipped because there is no related file in current project
'Analyzer for "php.ini" files' skipped because there is no related file in current project
'Python Squid Sensor' skipped because there is no related file in current project
'Import of TSLint issues' skipped because one of the required properties is missing
'Import of ESLint issues' skipped because one of the required properties is missing
Execute Sensor: Contextual SonarTS
[Info  - 12:02:57 PM] Started SonarTS Analysis
[Error - 12:02:58 PM] Rule error during analysis of : D:/GIT/Workspace/app/validation.service.ts TypeError: ts.unescapeIdentifier is not a function
[Error - 12:02:58 PM]     at getIdentifierText (C:\Users\theGuy\.sonarlint\work\.sonartmp_2702319790097580841\11009378949765029938\sonarts-bundle\node_modules\tsutils\util\util.js:872:15)
[Error - 12:02:58 PM]     at Object.getPropertyName (C:\Users\theGuy\.sonarlint\work\.sonartmp_2702319790097580841\11009378949765029938\sonarts-bundle\node_modules\tsutils\util\util.js:208:61)
[Error - 12:02:58 PM]     at cb (C:\Users\theGuy\.sonarlint\work\.sonartmp_2702319790097580841\11009378949765029938\sonarts-bundle\node_modules\tslint\lib\rules\noMisusedNewRule.js:57:27)
[Error - 12:02:58 PM]     at visitNodes (c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:15129:30)
[Error - 12:02:58 PM]     at Object.forEachChild (c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:15428:21)
[Error - 12:02:58 PM]     at cb (C:\Users\theGuy\.sonarlint\work\.sonartmp_2702319790097580841\11009378949765029938\sonarts-bundle\node_modules\tslint\lib\rules\noMisusedNewRule.js:67:19)
[Error - 12:02:58 PM]     at visitNodes (c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:15129:30)
[Error - 12:02:58 PM]     at Object.forEachChild (c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:15355:24)
[Error - 12:02:58 PM]     at walk (C:\Users\theGuy\.sonarlint\work\.sonartmp_2702319790097580841\11009378949765029938\sonarts-bundle\node_modules\tslint\lib\rules\noMisusedNewRule.js:49:15)
[Error - 12:02:58 PM]     at Rule.AbstractRule.applyWithFunction (C:\Users\theGuy\.sonarlint\work\.sonartmp_2702319790097580841\11009378949765029938\sonarts-bundle\node_modules\tslint\lib\language\rule\abstractRule.js:39:9)
[Info  - 12:02:58 PM] Finished SonarTS Analysis
'SonarJS' skipped because there is no related file in current project

Versions
Sonarlint: 1.5.0
Sonarqube: 6.7.4
VSCode: 1.27.2


(Alex Soh) #2

It seems upon further investigation, it was found that there was a 404 due to wrong reference to the sonarqube project id. After this was corrected there were no other further issues atm. Perhaps some improvement can be made in the future to provide notifications if there is a 404 while calling this API.