在sublime中配置linter, eslint sublime插件安裝
打開pci,安裝sublimeLinter
進入到,對path進行配置:
配置node的基本位置:/usr/local/bin/node, /usr/local/bin
配置node_modules的基本位置:/usr/local/lib/node_modules
配置其他各項插件的位置:如eslint: /usr/local/bin/eslint
示例代碼如下:
"paths": { "linux": [], "osx": [ "/usr/local/bin/node", "/usr/local/lib/node_modules", "/usr/local/bin/eslint", "/usr/local/bin/jslint" ], "windows": [] }安裝插件(以eslint為例):
安裝eslint的npm插件,包括:
sudo npm i eslint babel-eslint -g
將所安裝的工具的路徑放到的path中,即:/usr/local/bin/eslint
在項目中配置.eslintrc文件,類似:(每個項目都需要配置)
當中包括非常多的依賴,可以在項目中輸入eslint .,然后根據(jù)提示對缺少的依賴進行sudo npm i -g ***
然后就可以愉快的使用啦!
可以通過右鍵進入到sublimelinter來調用其功能。
.eslintrc文件示例{ "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 } }
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉載請注明本文地址:http://systransis.cn/yun/81139.html
摘要:的主要功能包括拼寫檢查,書簽,完整的,功能,即時項目切換,多選擇,多窗口等等。缺點是一款收費軟件,不過可以無限期使用。舉個栗子快速選中并更改所有相同的變量名函數(shù)名等。設置書簽,切換書簽左右字母互換。 Sublime text 簡介 Sublime text具有漂亮的用戶界面和強大的功能,例如代碼縮略圖,Python的插件,代碼段等。還可自定義鍵綁定,菜單和工具欄。Sublime Tex...
項目地址:Sublime-JSHint 安裝 Ctrl+Shift+P or Cmd+Shift+P in Linux/Windows/OS X 輸入 install, 選擇 Package Control: Install Package 輸入 js gutter, 選擇 JSHint Gutter 配置 Ctrl+Shift+P or Cmd+Shift+P 輸入 jshint, 選擇 ...
閱讀 3685·2021-10-11 11:09
閱讀 1349·2021-09-24 10:35
閱讀 3441·2021-07-29 13:48
閱讀 473·2019-08-30 13:15
閱讀 2526·2019-08-30 12:53
閱讀 3222·2019-08-30 12:44
閱讀 2719·2019-08-29 16:57
閱讀 968·2019-08-29 12:26