2015-09-01 24 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