我正在尝试关闭"no-use-before-define"
函数的规则,但让它对变量和类保持活动状态。
在此处找到的文档中http://eslint.org/docs/rules/no-use-before-define它说这是正确的配置语法:
"no-use-before-define": ["error", { "functions": false, "classes": true, "variables ": true }]
当我运行它时,虽然我收到了这个错误:
[21:00:46] Error: CLI:
Configuration for rule "no-use-before-define" is invalid:
Severity should be one of the following: 0 = off, 1 = warning, 2 = error (you passed "error").
Value "[object Object]" must be an enum value.
at Object.validateRuleOptions (E:\01-Dans stuff\Projects\00 - YeoSword\YeoSword-git\node_modules\gulp-eslint\node_modules\eslint\lib\config\config-validator.js:102:15)
at CLIEngine.<anonymous> (E:\01-Dans stuff\Projects\00 - YeoSword\YeoSword-git\node_modules\gulp-eslint\node_modules\eslint\lib\cli-engine.js:421:19)
at Array.forEach (native)
at new CLIEngine (E:\01-Dans stuff\Projects\00 - YeoSword\YeoSword-git\node_modules\gulp-eslint\node_modules\eslint\lib\cli-engine.js:420:43)
at Object.gulpEslint (E:\01-Dans stuff\Projects\00 - YeoSword\YeoSword-git\node_modules\gulp-eslint\index.js:17:15)
at E:/01-Dans stuff/Projects/00 - YeoSword/YeoSword-git/gulp/tasks/eslint.js:24:16
at taskWrapper (E:\01-Dans stuff\Projects\00 - YeoSword\YeoSword-git\node_modules\undertaker\lib\set-task.js:13:15)
at bound (domain.js:287:14)
at runBound (domain.js:300:12)
at asyncRunner (E:\01-Dans stuff\Projects\00 - YeoSword\YeoSword-git\node_modules\async-done\index.js:36:18)
我知道 gulp-eslint 语法与官方的 eslint 配置语法有点不同。
我无法弄清楚 gulp-eslint 的语法是什么{ "functions": false, "classes": true, "variables ": true }
。似乎在任何地方都没有任何文档。