If you are also using VS Code as the main editor for CabloyJS project development, you can refer to the official set of plug-ins you use, as well as some peripheral tools
This is the simplest set of plugins available for official beta testing, no more running around
The plug-in set
The plug-in name | use |
---|---|
Vim | Vim simulation |
ESLint | Format validation tool |
Prettier – Code formatter | Formatting tool |
Vetur | Vue language services |
.ejs | Ejs language service |
All Autocomplete | Generate autocomplete entries from open files |
settings.json
Open the system configuration file settings.json and add the following configuration:
{..."editor.tabSize": 2."editor.formatOnSave": true.// eslint
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.validate": ["javascript"."javascriptreact"."vue"].// prettier
"editor.defaultFormatter": "esbenp.prettier-vscode"."[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// vetur
"vetur.format.defaultFormatter.html": "js-beautify-html"."vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "aligned-multiple"}},// associations
"files.associations": {
"*.js.ejs": "javascript"."*.css.ejs": "css"."*.less.ejs": "less"},... }Copy the code
Code snippet
.vscode/cabloy.code-snippets are provided in the root directory of the project, so that we can quickly generate various code skeletons. The code snippets are as follows:
/** * supported code snippets as follows: * controller service model route * atom broadcast event local * middleware queue schedule sequence * startup stats test * * /
Copy the code
Boot Option Configuration
The startup configuration file.vscode/launch.json is provided in the root directory of the project, so that we can directly start the back-end service and enter the debugging environment