我有一个JSON,它工作正常,但是ESlint一直给我这个错误
未定义
'JSONEditor‘
我的代码存在于angularJS 1.7组件中。
this.$onInit = function () {
var container = $document[0].getElementById('jsoneditor');
var editor = new JSONEditor(container, { mode: 'code' }, json);
// code to use the editor
};没有什么复杂的,只有ESLint不满意。
发布于 2020-02-24 23:33:43
ESLint对代码中类的存在一无所知。您可以跳过它,或者从代码中注释它,或者将它添加到异常中。
发布于 2020-02-25 07:41:43
我增加了这一行,它解决了这个问题
/* global JSONEditor */https://stackoverflow.com/questions/60380453
复制相似问题