如何使用const禁用JSLint ES6错误并放入Adobe Brackets? [英] How to disable JSLint ES6 errors with const and let in Adobe Brackets?
本文介绍了如何使用const禁用JSLint ES6错误并放入Adobe Brackets?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经谷歌搜索并浏览了这个网站,但我只能找到JSHint而不是JSLint的答案。
为了摆脱使用函数形式的使用严格错误,我添加了 / * jslint节点:true * /
。
但要禁用使用 const
和的错误,请
我似乎找不到任何东西。 JSHint有esversion:6但这对JSLint不起作用。
I have Googled and looked through this site everywhere, but I can only find answers for JSHint instead of JSLint.
To get rid of the "use function form of use strict" error I add in /*jslint node: true */
.
But to disable errors for using const
and let
I can't seem to find anything. JSHint has esversion: 6 but this doesn't work on JSLint.
推荐答案
使用首选项API:
var PreferencesManager = brackets.getModule("preferences/PreferencesManager");
prefs = PreferencesManager.getExtensionPrefs("jslint");
prefs.set("options.es6", true);
或者设置其中一个配置文件:
Or set it one of the config files:
- 用户目录的
bracket.json
文件
- the
brackets.json
file of the user directory
或:
-
.brackets.json
的文件项目目录:
- the
.brackets.json
file of the project directory:
因此:
{
"jslint.options": {
"es6": true
}
}
参考文献
PreferencesManager - Brackets API
这篇关于如何使用const禁用JSLint ES6错误并放入Adobe Brackets?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文