vsCode开发常用配置

  |  

在 settings.json 中写入

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe", #把控制界面设置成git命令输入界面
"git.path": "C:\\Program Files\\Git\\bin\\git.exe", # vscode 集成git
"gitlens.advanced.messages": {
"suppressGitVersionWarning": true
},
"editor.codeActionsOnSave": {# eslint 保存自动格式化
"source.fixAll.eslint": true
},
"explorer.confirmDelete": false,
"remote.SSH.remotePlatform": {
"tri": "linux",
"klover": "linux"
},
"workbench.list.openMode": "doubleClick"
}

1. 好用的vscode 插件
eslint
Git supercharged #git日志显示
Remote Development #vscode远程操作
Code Spell Checker # 驼峰命名错误 提示
Chinese (Simplified) (简体中文) Language Pack for Visual Studio Code
Prettier - Code formatter



vue
Vetur
  1. jest 的使用
    安装 vscode 插件 Jest Runner

    在 package.json 中配置

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    "jest": {
    "moduleFileExtensions": [
    "js",
    "json",
    "ts"
    ],
    "rootDir": ".",
    "testRegex": ".spec.ts$",
    "transform": {
    "^.+\\.(t|j)s$": "ts-jest"
    },
    "coverageDirectory": "./coverage",
    "testEnvironment": "node",
    "roots": [
    "<rootDir>/test/",
    "<rootDir>/libs/"
    ]
    },

    注意:“roots” 下配置你 spec.ts 文件所在的位置 不然无效

    配置好 就会如下显示
    在这里插入图片描述

出现问题

  1. 由于服务器出现问题 更换了服务器但是 ip 没有更换 导致 vscode 连接远程报

(1)ssh hostname 或报下面错误

1
2
3
4
5
6
7
8
9
10
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:sl+TVt6TNVzIBfCBuTEP/ylD9VmnVTjYncZjnDaMUSU.
Please contact your system administrator.
Add correct host key in /c/Users/edz/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /c/Users/edz/.ssh/known_hosts:9
ECDSA host key for 39.108.155.220 has changed and you have requested strict checking.
Host key verification failed.

(2) vscode 直接连接报
vscode could not establish connection to: XXXX.

文章目录
  1. 1. 出现问题