打開pci
,安裝sublimeLinter
javascript
進入到,對path進行配置:php
配置node的基本位置:/usr/local/bin/node, /usr/local/binhtml
配置node_modules的基本位置:/usr/local/lib/node_modules
java
配置其餘各項插件的位置:如eslint: /usr/local/bin/eslint
node
示例代碼以下:python
"paths": { "linux": [], "osx": [ "/usr/local/bin/node", "/usr/local/lib/node_modules", "/usr/local/bin/eslint", "/usr/local/bin/jslint" ], "windows": [] }
安裝eslint的npm插件,包括:linux
sudo npm i eslint babel-eslint -g
es6
將所安裝的工具的路徑放到的path中,即:/usr/local/bin/eslint
shell
在項目中配置.eslintrc文件,相似:(每一個項目都須要配置)npm
當中包括很是多的依賴,能夠在項目中輸入eslint .
,而後根據提示對缺乏的依賴進行sudo npm i -g ***
而後就能夠愉快的使用啦!
能夠經過右鍵進入到sublimelinter
來調用其功能。
{ "env": { "browser": true, "node": true, "es6": true }, "parser": "babel-eslint", "extends" : [ "airbnb" ], "plugins": [ "babel", "promise" ], "ecmaFeatures": { "jsx": true }, "rules": { "semi": [2, "always"], "quotes": [2, "single"] } }
展現一下配置完成後的sublimelinter-user.settings
:
{ "user": { "debug": true, "delay": 0.25, "error_color": "D02000", "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme", "gutter_theme_excludes": [], "lint_mode": "background", "linters": { "eslint": { "@disable": false, "args": [], "ecmaFeatures": { "jsx": true }, "env": { "browser": true, "es6": true, "node": true }, "excludes": [], "extends": [ "standard" ], "parser": "babel-eslint", "plugins": [ "babel", "promise" ], "rules": { "quotes": [ 2, "single" ], "semi": [ 2, "always" ] } }, "jsxhint": { "@disable": false, "args": [], "excludes": [] } }, "mark_style": "stippled underline", "no_column_highlights_line": false, "passive_warnings": false, "paths": { "linux": [], "osx": [ "/usr/local/bin/node", "/usr/local/lib/node_modules", "/usr/local/bin/eslint" ], "windows": [] }, "python_paths": { "linux": [], "osx": [], "windows": [] }, "rc_search_limit": 3, "shell_timeout": 10, "show_errors_on_save": false, "show_marks_in_minimap": true, "syntax_map": { "html (django)": "html", "html (rails)": "html", "html 5": "html", "javascript (babel)": "javascript", "magicpython": "python", "php": "html", "python django": "python", "pythonimproved": "python" }, "warning_color": "DDB700", "wrap_find": true } }