当前位置:网站首页>Vscode code style notes (vetur)
Vscode code style notes (vetur)
2022-07-24 08:10:00 【longlongValue】
install Vetur

setting.json Old configuration ( use ESLint)
{
"editor.tabSize": 4,
"eslint.format.enable": true,
// Open or not vscode Of eslint
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
// Press eslint Format for repair
"editor.formatOnSave": true,
// Format automatically when pasting
"editor.formatOnPaste": true,
// add to vue Support , use eslint Rule detection file
"eslint.validate": [
"javascript",
"css",
"vue",
],
"eslint.options": {
"extensions": [
".ts",
".tsx",
".js",
".vue",
".css",
]
},
// Configuration language file association ( Such as : "*.extension": "html"). These associations take precedence over the default associations for the installed language .
"files.associations": {
"*.vue": "vue",
"*.cjson": "jsonc",
"*.wxss": "css",
"*.wxs": "javascript"
},
// To configure glob Mode to exclude files and folders from full-text search and quick open . from “#files.exclude#” Set to inherit all glob Pattern .
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/dist": true,
".idea/": true,
".svn/": true,
".vscode/": true,
"**/.map": true,
},
// Adjust the zoom level of the window . The original size is 0
"window.zoomLevel": 0,
// Controls how the editor displays symbols on white space characters . boundary: Render space characters ( Except for a single space between words ).
"editor.renderWhitespace": "boundary",
// Control the animation style of the cursor .
"editor.cursorBlinking": "smooth",
// Controls whether thumbnails are displayed .
"editor.minimap.enabled": true,
// Render the actual characters of each line , Instead of color patches
"editor.minimap.renderCharacters": false,
// Control the window title according to the active editor .
"window.title": "${dirty}${activeEditorMedium}${separator}${rootName}",
// Controls whether code snippets are displayed with other suggestions and where they are arranged . top: Show code snippet suggestions above other suggestions .
"editor.snippetSuggestions": "top",
"eslint.codeAction.showDocumentation": {
"enable": true
},
// The syntax expansion prompt pops up explicitly
"emmet.showSuggestionsAsSnippets": true,
//emmet Only display the expansion prompt of markup language and style sheet
"emmet.showExpandedAbbreviation": "inMarkupAndStylesheetFilesOnly",
// Enable... In languages that are not supported by default Emmet abbreviation . In this language and Emmet Add mapping between supported languages
"emmet.includeLanguages": {
"wxml": "html",
"vue": "html",
"vue-html": "html",
"javascript": "javascriptreact"
},
// by Emmet Define a profile or use a profile with specific rules .
"emmet.syntaxProfiles": {
"javascript": "jsx",
"vue": "html",
"vue-html": "html"
},
"minapp-vscode.disableAutoConfig": true,
"eslint.nodeEnv": "",
"[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
// choice vue In file template Format tool for
"vetur.format.defaultFormatter.html": "prettyhtml",
// Act on js file
"vetur.format.defaultFormatter.js": "prettier-eslint",
// A little basic setting
"vetur.format.defaultFormatterOptions": {
"prettier": {
"singleQuote": true, // single quote
"semi": false, // Without a semicolon
}
},
}
setting.json New configuration
{
"window.zoomLevel": 0,
"vetur.format.options.tabSize": 4,
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatter.stylus": "stylus-supremacy",
"vetur.format.defaultFormatter.css": "prettier",
"vetur.format.defaultFormatter.sass": "sass-formatter",
"vetur.format.defaultFormatter.postcss": "prettier",
"vetur.format.defaultFormatter.scss": "prettier",
"vetur.format.defaultFormatter.less": "prettier",
"vetur.format.defaultFormatter.ts": "prettier",
// script Whether indent is required in
"vetur.format.scriptInitialIndent": true,
// style Whether indent is required in
"vetur.format.styleInitialIndent": true,
// Currently in use prettier The function name or function Remove the space after the keyword , This and the default EsLink Configuration conflict for . There are two solutions ,
// But it can't be solved perfectly , It is suggested that EsLint Pass through "space-before-function-paren":0 Temporarily cancel this check .
// Reference plan 1: Cannot give without omitting function Keyword named function plus space
// "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
// Reference plan 2: Out of commission prettier
// "vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
// html Code attributes do not wrap .force-aligned Indicates forced line break alignment
"wrap_attributes": "auto"
},
"prettyhtml": {
"printWidth": 120,
"singleQuote": false,
"wrapAttributes": false,
"sortAttributes": false
},
"prettier": {
"printWidth": 120,
// Without a semicolon
"semi": false,
// Static strings always use single quotation marks or back quotation marks , No double quotes .
"singleQuote": true,
// A single line defined object , The last member does not end with a comma . Multiline defined objects , The last member ends with a comma .
"trailingComma": "none",
"wrapAttributes": true,
"sortAttributes": false
}
},
"files.associations": {
"*.cjson": "jsonc",
"*.wxss": "css",
"*.wxs": "javascript"
},
// To configure glob Mode to exclude files and folders from full-text search and quick open . from “#files.exclude#” Set to inherit all glob Pattern .
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/dist": true,
".idea/": true,
".svn/": true,
".vscode/": true,
"**/.map": true,
},
// The syntax expansion prompt pops up explicitly
"emmet.showSuggestionsAsSnippets": true,
//emmet Only display the expansion prompt of markup language and style sheet
"emmet.showExpandedAbbreviation": "inMarkupAndStylesheetFilesOnly",
// Enable... In languages that are not supported by default Emmet abbreviation . In this language and Emmet Add mapping between supported languages
"emmet.includeLanguages": {
"wxml": "html",
"vue": "html",
"vue-html": "html",
"javascript": "javascriptreact"
},
// by Emmet Define a profile or use a profile with specific rules .
"emmet.syntaxProfiles": {
"javascript": "jsx",
"vue": "html",
"vue-html": "html"
},
"minapp-vscode.disableAutoConfig": true,
// Controls whether the resource manager confirms when deleting files to the wastebasket
"explorer.confirmDelete": false,
// Controls whether code snippets are displayed with other suggestions and where they are arranged . top: Show code snippet suggestions above other suggestions .
"editor.snippetSuggestions": "top",
// Format automatically when saving
"editor.formatOnSave": true,
// Format automatically when pasting
"editor.formatOnPaste": true,
}
“eslint:recommended”
package.json To configure
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"@vue/standard"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {
"space-before-function-paren": [
0,
"always"
],
"indent": "off"
}
},
边栏推荐
- [Beijiao] image processing: basic concepts, image enhancement, morphological processing, image segmentation
- P1739表达式括号匹配题解
- Kotlin higher order function & DSL layout persuasion Guide
- RBM contrast divergence
- 加密熊市:有人大举扩张 有人裁员收缩
- P1135 奇怪的电梯题解
- P1739 expression bracket matching problem solution
- [target detection] IOU (intersection and combination ratio)
- Collection of sorting topics
- Default risk early warning preliminary competition scheme of bond issuing enterprises [AI competition]
猜你喜欢

图新地球:如何导入修改了高程基准(椭球)的CAD文件

Generative model and discriminant model

Super simple countdown code writing

rbm 对比散度

图新地球:Revit建模的rvt格式BIM模型如何带着纹理精准匹配地图

The vision group of Hegong University Sky team trained day3 - machine learning, strengthened the use of Yolo models, and learned pumpkin books and watermelon books

Do you want to have a robot that can make cartoon avatars in three steps?

NFT概念究竟是怎么回事。。全面了解NFT市场、技术和案例

Learning to track at 100 FPS with deep progression networks

Figure New Earth: how the RVT format BIM model modeled by Revit can accurately match the map with texture
随机推荐
【MATLAB】(三)MATLAB在高等数学中的应用
Kubernetes:(一)基本概念
Talk about compilers based on vscode
【游戏合集】手机都要被塞爆了,6款优质Pygame游戏合集降临~(附源码)
Digital twin demonstration project -- Talking about simple pendulum (3) solid model exploration
Image feature Harris corner detection
Detailed explanation of VAO
Thesis reading: geotransformer
Assemble | find the maximum and minimum values
Kotlin coroutine (I): foundation and deepening
Project practice - document scanning OCR recognition
A knight's journey
P1739 expression bracket matching problem solution
Hcip day 10 notes
Default risk early warning preliminary competition scheme of bond issuing enterprises [AI competition]
Intelligent robot and intelligent system (Professor Zhengzheng of Dalian University of Technology) -- 5. Bionic robot
QT | string generation QR code function
mysql使用explain分析sql执行计划帮助查找性能瓶颈
NFT概念究竟是怎么回事。。全面了解NFT市场、技术和案例
55. Jumping game