VsCode 插件
eslint
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
1
2
3
4
5
6
2
3
4
5
6
注意
需要安装 eslint 插件 跟 npm 包
prettier
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
// "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.printWidth": 150, // 超过最大值换行
"prettier.tabWidth": 4, // 缩进字节数
"prettier.arrowParens": "avoid", //(x) => {} 箭头函数参数只有一个时是否要有小括号。avoid:省略括号
"prettier.semi": true, // 句尾添加分号
"prettier.bracketSpacing": true, // 在对象,数组括号与文字之间加空格 "{ foo: bar }"
"prettier.singleQuote": false, //true为单引号 false为双引号
"prettier.disableLanguages": [
"vue"
],
"prettier.insertPragma": false, //格式化完以后会在开头位置插入/** @format */
"prettier.jsxBracketSameLine": false, // 在jsx中把'>' 是否单独放一行
"prettier.jsxSingleQuote": false, // 默认值 给对象的key 是否添加引号 { a: b } 其中a 为key
"prettier.stylelintIntegration": false, //不让prettier使用stylelint的代码格式进行校验
"prettier.tslintIntegration": false,
"prettier.ignorePath": "", // 不让prettier使用tslint的代码格式进行校验//
"prettier.endOfLine": "crlf",
"prettier.trailingComma": "none",
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
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
别名跳转
"alias-skip.allowedsuffix": [
"js",
"vue",
"jsx",
"ts",
"css"
],
"alias-skip.mappings": {
"@": "/client",
"@js": "/client/js",
"@css": "/client/css",
},
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12