在sublime中配置linter, eslint sublime插件安裝
打開(kāi)pci,安裝sublimeLinter
進(jìn)入到,對(duì)path進(jìn)行配置:
配置node的基本位置:/usr/local/bin/node, /usr/local/bin
配置node_modules的基本位置:/usr/local/lib/node_modules
配置其他各項(xiàng)插件的位置:如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
在項(xiàng)目中配置.eslintrc文件,類似:(每個(gè)項(xiàng)目都需要配置)
當(dāng)中包括非常多的依賴,可以在項(xiàng)目中輸入eslint .,然后根據(jù)提示對(duì)缺少的依賴進(jìn)行sudo npm i -g ***
然后就可以愉快的使用啦!
可以通過(guò)右鍵進(jìn)入到sublimelinter來(lái)調(diào)用其功能。
.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 } }
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://m.specialneedsforspecialkids.com/yun/81139.html
摘要:的主要功能包括拼寫檢查,書簽,完整的,功能,即時(shí)項(xiàng)目切換,多選擇,多窗口等等。缺點(diǎn)是一款收費(fèi)軟件,不過(guò)可以無(wú)限期使用。舉個(gè)栗子快速選中并更改所有相同的變量名函數(shù)名等。設(shè)置書簽,切換書簽左右字母互換。 Sublime text 簡(jiǎn)介 Sublime text具有漂亮的用戶界面和強(qiáng)大的功能,例如代碼縮略圖,Python的插件,代碼段等。還可自定義鍵綁定,菜單和工具欄。Sublime Tex...
項(xiàng)目地址: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, 選擇 ...
閱讀 3682·2021-10-11 11:09
閱讀 1346·2021-09-24 10:35
閱讀 3437·2021-07-29 13:48
閱讀 468·2019-08-30 13:15
閱讀 2522·2019-08-30 12:53
閱讀 3213·2019-08-30 12:44
閱讀 2717·2019-08-29 16:57
閱讀 967·2019-08-29 12:26