gpt4 book ai didi

javascript - Gruntfile.js 中的 JSLint 错误

转载 作者:行者123 更新时间:2023-12-02 16:55:29 25 4
gpt4 key购买 nike

我编写了一个 Gruntfile.js,在其中调用 grunt.file.delete(),JSLint 对我咆哮,说:“需要一个标识符,却看到了‘删除’(保留字)。 grunt.file.delete(config[task].dest);"

config 是一个对象,task 是与任务名称匹配的字符串,dest 是路径字符串。

我已经在文件顶部设置了 /*jslint node:true */

有谁知道这是否是一个有效的问题,如果是,其依据是什么以及我该如何解决它?

最佳答案

根据https://github.com/gruntjs/grunt/issues/752

If you enable the es5 option for linting your Gruntfile with JSHint, this error should go away.

或者,只需将 grunt.file.delete 更改为 grunt.file['delete']

关于javascript - Gruntfile.js 中的 JSLint 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26218322/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com