vscode代码格式化配置,配合package.json

5 篇文章 1 订阅
1 篇文章 0 订阅

package.json配置

vscode setting.json配置

{
	"editor.tabSize": 2,
	"files.associations": {
		"*.vue": "vue"
	},
	"eslint.options": {
		"extensions": [".js", ".vue"]
	},
	// 添加vue支持
	"eslint.validate": ["javascript", "javascriptreact", "vue"],
	"search.exclude": {
		"**/node_modules": true,
		"**/bower_components": true,
		"**/dist": true
	},
	"emmet.syntaxProfiles": {
		"javascript": "jsx",
		"vue": "html",
		"vue-html": "html"
	},
	"git.confirmSync": false,
	"window.zoomLevel": 0,
	"editor.renderWhitespace": "boundary",
	"editor.cursorBlinking": "smooth",
	"editor.minimap.enabled": true,
	"editor.minimap.renderCharacters": false,
	// "editor.fontFamily": "'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
	"window.title": "${dirty}${activeEditorMedium}${separator}${rootName}",
	"editor.codeLens": true,
	"editor.snippetSuggestions": "top",
	"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
	"vetur.format.defaultFormatter.js": "vscode-typescript",
	// "vetur.format.defaultFormatter.html": "js-beautify-html",
	// jsx自动修复有问题,取消js的format
	"editor.formatOnSave": false,
	// Enable/disable default JavaScript formatter (For Prettier)
	"javascript.format.enable": false,
	"prettier.singleQuote": true,
	// 点击保存时,根据 eslint 规则自定修复,同时集成 prettier 到 eslint 中
	"prettier.eslintIntegration": true,
	"editor.formatOnType": true,
	"prettier.tabWidth": 4,
	"vetur.format.defaultFormatter.html": "prettier",
	"editor.fontSize": 14,
	// "files.autoSave": "afterDelay",
	"workbench.editor.enablePreview": false,
	"workbench.editor.enablePreviewFromQuickOpen": false,
	"editor.codeActionsOnSave": {
		"source.fixAll.eslint": true
	},
	"editor.suggest.snippetsPreventQuickSuggestions": false,
	"[javascript]": {},
	"workbench.startupEditor": "newUntitledFile",
	"auto-close-tag.activationOnLanguage": [
		"xml",
		"php",
		"blade",
		"ejs",
		"jinja",
		"javascript",
		"javascriptreact",
		"typescript",
		"typescriptreact",
		"plaintext",
		"markdown",
		"vue",
		"liquid",
		"erb",
		"lang-cfml",
		"cfml",
		"HTML (EEx)",
		"HTML (Eex)",
		"plist"
	],
	"vetur.format.defaultFormatterOptions": {
		"js-beautify-html": {
			"wrap_attributes": "auto"
			// #vue组件中html代码格式化样式
		},
		"prettyhtml": {
			"printWidth": 100,
			"singleQuote": false,
			"sortAttributes": false,
			"wrapAttributes": false
		}
	}
}

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值