module.exports = { root: true, parserOptions: { parser: "babel-eslint", }, env: { browser: true, }, extends: ["plugin:vue/essential"], // required to lint *.vue files plugins: ["vue"], // add your custom rules here rules: { // quotes: [2, "single"], // "default-case": "error", // semi: [2, "always"], // 语句强制分号结尾 // "key-spacing": [1, { beforeColon: false, afterColon: true }], // 对象字面量中冒号的前后空格 // "no-multiple-empty-lines": [1, { max: 1 }], // 空行最多不能超过2行 // "no-dupe-keys": 2, // 在创建对象字面量时不允许键重复 {a:1,a:1} // "no-spaced-func": 2, // 函数调用时 函数名与()之间不能有空格 // "no-trailing-spaces": 1, // 一行结束后面不要有空格 // "no-unreachable": 2, // 不能有无法执行的代码 // "no-unused-vars": [2, { vars: "all", args: "after-used" }], // 不能有声明后未被使用的变量或参数 // "no-var": 0, // 禁用var,用let和const代替 // "comma-dangle": [2, "never"], // 对象字面量项尾不能有逗号 // "comma-spacing": 1, // 逗号前后的空格 // "comma-style": [2, "last"], // 逗号风格,换行时在行首还是行尾 // eqeqeq: 2, // 必须使用全等 // indent: [2, 2], // 缩进风格 // "spaced-comment": 1, // 注释风格要不要有空格 // "eol-last": 2, // 文件以单一的换行符结束 // "semi-spacing": [2, { before: false, after: true }], // 分号前后空格 // "arrow-spacing": 2, // =>的前/后括号 }, };