The method of realizing Code Detection in sublime
This article will explain in detail how to achieve code detection in sublime. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Configure linter, eslint in sublime
Sublime plug-in installation
Open pci and install sublimeLinter
Go to and configure path:
The basic location of ● configuration node: / usr/local/bin/node, / usr/local/bin
The basic location of ● configuration node_modules: / usr/local/lib/node_modules
● configure the location of other plug-ins, such as eslint: / usr/local/bin/eslint
The sample code is as follows:
"paths": {"linux": [], "osx": ["/ usr/local/bin/node", "/ usr/local/lib/node_modules", "/ usr/local/bin/eslint", "/ usr/local/bin/jslint"], "windows": []}
Install the plug-in (take eslint as an example):
Install the npm plug-in for eslint, including:
● sudo npm i eslint babel-eslint-g
● puts the path of the installed tool into the path, that is: / usr/local/bin/eslint
● configures the .eslintrc file in the project, similar to: (each project needs to be configured)
● includes a lot of dependencies. You can type eslint. In the project, and then follow the prompts to sudo npm i-g * * for the missing dependencies
Then you can use it happily!
You can invoke its function by right-clicking into sublimelinter.
.eslintrc file example
{"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"]}}
Last
Show the sublimelinter-user.settings after configuration:
{"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}} this is the end of the article on "how to implement code detection in sublime". Hope that the above content can be helpful to you, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.