0

当我尝试使用 ESLint 插件Nodeca时,SublimeLinter 停止掉毛

这是我的 .eslintrc:

{ "env": { "browser": true, "node": true }, "plugins":["nodeca"], "rules": { "quotes": 0, "no-underscore-dangle": 0, "no-path-concat": 0, "valid-jsdoc": 1, "no-reserved-keys": 1, "block-scoped-var": 1, "no-lonely-if": 1, "no-nested-ternary": 1, "no-multiple-empty-lines": 1, "space-after-keywords": [1, "always"], "space-before-blocks": [1, "always"], "nodeca/indent": [2, "spaces", 4] } }

我知道它只是那个插件,因为当我注释掉这些行时它可以工作

"plugins":["nodeca"], "nodeca/indent": [2, "spaces", 4]

Sublime 控制台显示:

SublimeLinter: eslint: Grunt.config.js ['/usr/local/bin/eslint', '--format=compact', '--stdin'] SublimeLinter: eslint output: <text>: line 16, col 48, Error - Trailing comma. (no-comma-dangle) 1 problem

但是当我把这些行放回使用 nodeca 时,linter 停止工作,我在控制台中得到了这个:

SublimeLinter: eslint: Grunt.config.js ['/usr/local/bin/eslint', '--format=compact', '--stdin']

我知道插件是随节点一起安装的,因为我在 package.json 和 npm 列表中看到了它。

我是前端开发的新手,所以您能给我的任何帮助将不胜感激!

谢谢!

4

1 回答 1

0

原来,我只需要全局安装节点插件:

sudo npm install eslint-plugin-nodeca -g

于 2015-02-04T18:56:12.443 回答