1. 汉化
安装 Chinese (Simplified) Language Pack for Visual Studio Code 插件,完成后重启 VS Code 即可。
2. 括号上色
为代码中成对的括号设置不同的颜色高亮,便于阅读。
Bracket Pair Colorizer 2
3. 显示文件大小
4. 缩进高亮
5. Vue 支持
6. ESLint
在项目根目录添加规则文件.eslintrc.js,插件将根据其中的规则检查代码,以下是一个简单示例:
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
node: true
},
extends: [
'standard'
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parserOptions: {
ecmaVersion: 11
},
rules: { }
}
如果不想让工具检查某个文件或某行代码,可在代码前写入注释/* eslint-disable */禁用。
如果需要忽略多个文件的 lint 检查,可在项目根目录创建一个.eslintignore文件,写在该文件内的目录/文件将被忽略。
build
node_modules
doc
在settings.json中加入下面的配置,保存时尝试修复错误:
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
7.Highlight Matching Tag
8.Color Highlight
9.Trailing Spaces
10.Git History
11.open in browser
12.Auto Rename Tag
13.Auto Import
14.javascript console utils
15.Path Intellisense
16.Npm Intellisense