Javascript 包含 ES7 装饰器的 .js 文件分析失败
Javascript analysis fail for .js files containing ES7 Decorators
我目前正在使用 Babel(Javascript 转译器),它允许我现在使用未来的语法。我正在使用装饰器功能 (https://github.com/wycats/javascript-decorators)。然而,当我 运行 分析该代码时,SonarQube 抛出以下错误:
[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 问题?
来自 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 票证,您可以在其中投票以表明他们需要此功能。
我目前正在使用 Babel(Javascript 转译器),它允许我现在使用未来的语法。我正在使用装饰器功能 (https://github.com/wycats/javascript-decorators)。然而,当我 运行 分析该代码时,SonarQube 抛出以下错误:
[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 问题?
来自 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 票证,您可以在其中投票以表明他们需要此功能。