2015-09-01 68 views
4

我目前使用的是Babel(Javascript轉譯器),它允許我現在使用未來的語法。我正在使用裝飾器功能(https://github.com/wycats/javascript-decorators)。然而,當我對該代碼運行分析時,SonarQube會拋出以下錯誤:包含ES7裝飾器的.js文件的Javascript分析失敗

[09:19:43] 09:19:43.693錯誤 - 無法解析文件:/...../my-form.js 09:19:43.693錯誤 - 在第10行第1列解析錯誤:

1: import {View, Component, Inject, NgScope} from 'app/app'; 
... 
9: 
10: @Component({ 
    ^
11: selector: 'my-form' 
12: }) 
13: @View({ 
14: template: myTemplate 
15: }) 

將這個被被Javascript插件很快覆蓋(或由解析器至少跳過,但允許它繼續該文件的處理) ?。 有沒有辦法爲此提交JIRA問題?

回答

2

從SonarQube用戶組:

Regarding the support of the decorator construction, it will not be supported by the JavaScript plugin as long as it will not be part of the ECMAScript Standard. Moreover when the JavaScript plugin is not able to parse a file the analysis should not fail, it should succeed but no issue will be reported on the unparsed file.

然而已經有一個JIRA票,你可以投票,以示他們對這一功能的需求。

JIRA - Support experimental JavaScript features