【发布时间】:2015-06-04 16:39:02
【问题描述】:
我正在一个角度页面中处理来自 twitter 的 oauth 响应,该页面读取如下参数:
var oauthToken = $location.search().oauth_token;
Jshint 会抱怨因为
line 13 col 0 Identifier 'oauth_token' is not in camel case.
或者我可以写成
var oauthToken = $location.search()['oauth_token'];
但是 jshint 会抱怨
line 13 col 40 ['oauth_token'] is better written in dot notation.
有没有推荐的方法来处理这些而不使用 //jshint ignore:line 注释?
【问题讨论】:
标签: javascript angularjs oauth jshint