SublimeLinter - nodeca插件

时间:2015-02-04 18:40:00

标签: javascript lint sublimelinter

当我尝试使用ESLint插件时,SublimeLinter会停止linting Nodeca

这是我的.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列表中看到它。

我对前端开发很新,所以你能给我的任何帮助都将不胜感激!

谢谢!

1 个答案:

答案 0 :(得分:0)

事实证明,我只需要全局安装节点插件:

sudo npm install eslint-plugin-nodeca -g