quick create vue project

Quick Start | Vue.js (vuejs.org)open in new window

npm init vue@latest

Using Vue with TypeScript | Vue.js (vuejs.org)open in new window

vscode

命令面板ctrl+shift+p

// 打开默认的配置
> open default Settings

volar插件

Volar格式化代码不生效,可以采用prettier。prettier默认也支持eslint

---来自Tooling | Formatting Vue.js open in new window

{
	"[vue]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode",
		"editor.formatOnSave": true
	}
}

eslint与prettier的稍微修改

消除eslint中美化的校验eslint-config-prettieropen in new window : Turns off all rules that are unnecessary or might conflict with Prettier。

/* eslint-env node */
require("@rushstack/eslint-patch/modern-module-resolution")
module.exports = {
  root: true,
  extends: [
    "plugin:vue/vue3-essential",
    "eslint:recommended",
    "@vue/eslint-config-typescript",
    "@vue/eslint-config-prettier",
    "prettier", // 新添加
  ],
  parserOptions: {
    ecmaVersion: "latest",
  },
}


[What Does JavaScript Void(0) Mean? (quackit.com)](https://www.quackit.com/javascript/tutorial/javascript_void_0.cfm#:~:text=The JavaScript void operator evaluates,produce an unwanted side-effect.)

<a href="JavaScript:void(0);" ondblclick="alert('Well done!')">Double Click Me!</a>