当前位置:网站首页>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"
}
},
边栏推荐
- [Linux] Oracle VirtualBox installation CentOS 8
- Debug No4 use renderdoc to troubleshoot bugs
- 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
- [golang from introduction to practice] student achievement management system
- 【golang从入门到实践】学生成绩管理系统
- 我在微软的这六个月
- Robert operator, Sobel operator, Laplace operator
- 加密熊市:有人大举扩张 有人裁员收缩
- how to add square on screenshot
- MySQL update uses case when to update the value of another field according to the value of one field
猜你喜欢

What is the NFT concept.. Fully understand NFT market, technology and cases

Function analysis of e-commerce website development and construction

JSON extractor use in JMeter

Super simple countdown code writing

Hegong sky team vision training Day2 - traditional vision, opencv basic operation

Why is knowledge base important? This is the best answer I've ever heard

SVM linear separable linear support vector machine

FPGA综合项目——图像边缘检测系统

Hcip 13th day notes
![[Beijiao] image processing: basic concepts, image enhancement, morphological processing, image segmentation](/img/b3/76d2bcdf4b9769fb6308b7dac9ceb5.jpg)
[Beijiao] image processing: basic concepts, image enhancement, morphological processing, image segmentation
随机推荐
Figure New Earth: how the RVT format BIM model modeled by Revit can accurately match the map with texture
Learning to track at 100 FPS with deep progression networks
Function analysis of e-commerce website development and construction
Introduction of some functions or methods in DGL Library
45. Jumping game II
我在微软的这六个月
Example of dictionary
[matlab] (III) application of MATLAB in Higher Mathematics
【MATLAB】(三)MATLAB在高等数学中的应用
Natural language processing hanlp
MySQL --- 子查询 - 标量子查询
Figure New Earth: how to import CAD files with modified elevation datum (ellipsoid)
MS SQL Server 2019 learning
Intelligent robot and intelligent system (Professor Zhengzheng of Dalian University of Technology) -- 5. Bionic robot
Zhouzhihua machine learning watermelon book chapter 2 model evaluation and selection - accuracy and model generalization evaluation method, self-help method and integrated learning
Installation and use of CONDA
[Linux] Oracle VirtualBox installation CentOS 8
[interview] Why do you need foreach with the for cycle?
学习笔记总结篇(一)
Semantic slam: Probabilistic Data Association for semantic slam