Using javascript libraries in Adobe Brackets IDE?

痞子三分冷 提交于 2019-12-23 19:53:22

问题


How do you use libraries in Brackets without the javascript lint giving errors? For example I am using chart.js and the product works completely fine but Brackets gives an error that Chart was used before being defined. Is there any way to hide this error? I find it helpful for other things but having it always pop up because of one error is annoying. This could be an error on my part as well, maybe I must define the variable even though it is part of the library?


回答1:


You need to supply jslint options at the top of the js file, for example:

/*global window, jQuery, require, charts */

There might also be a way to do this globally, i just haven't researched it yet (don't really see a need for it)



来源:https://stackoverflow.com/questions/22545259/using-javascript-libraries-in-adobe-brackets-ide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!