Dojo lint - Dojo 有没有好的 lint 工具,而不仅仅是 javascript
我知道有很多 JavaScript lint 工具,但我想知道是否也有适用于 Dojo 的工具,因为 dojo 引用会给普通 JS lint 工具带来问题。
谢谢
I know there are plenty of JavaScript lint tools, but I was wondering if there were any for Dojo also since dojo references cause problems for normal JS lint tools.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JSHint 可以很好地处理 dojo(甚至有一个小标志)。我确实怀念它不检查我的提供和要求*。
您不能在您最喜欢的工具中向全局命名空间添加额外的名称吗?
* 编辑:现在有了新的异步模块,如果您忘记导入模块,jshint 会发出警告(因为它现在只是一个常规变量,而不是正在访问的嵌套对象属性)。但是,如果有未使用的函数参数(即不必要地导入模块),它不会警告您。就我而言,我破解了 JSHint 源代码并为其添加了警告。
JSHint handles dojo fine (and even has a little flag for it). I do miss it not checking my provides and requires though*.
Can't you add extra names to the global namespace in your favourite tool?
* Edit: Now with the new async modules, jshint will warn if you forgot to import a module (since its just a regular variable now, instead of a nested object property being accessed). However, it will not warn you if there are unused function arguments (ie, modules being imported needlessly). In my case I hacked the JSHint source code to add a warning to that.