module.exports = { root: true, env: { node: true }, plugins: ['prettier'], extends: ['plugin:vue/essential', '@vue/prettier'], rules: { 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', quotes: ['error', 'single'], //强制使用单引号 semi: ['error', 'never'], //强制不使用分号结尾 eqeqeq: ['error', 'always'], // 强制在任何情况下都使用 === 和 !== 'prettier/prettier': 0, 'no-trailing-spaces': 1, // 一行结束后面不要有空格 'array-bracket-spacing': [2, 'never'], // 不允许非空数组里面有多余的空格 'no-multiple-empty-lines': [1, { max: 1 }], // 空行最多不能超过2行 'block-spacing': [1, 'always'], // 使块内有一定间距,这里不包括对象 {},而是指 if () { <- -> } 或 function () { <- -> } 'object-curly-spacing': [1, 'always'], // 使对象内有一定间距 { <- -> } 'no-multi-spaces': [1, { ignoreEOLComments: true }], // 禁止连续多个不用于缩进的空格(注释前那段除外) 'key-spacing': [1, { beforeColon: false, afterColon: true }], // 对象字面量中冒号的前后空格 'arrow-spacing': [1, { before: true, after: true }], 'comma-dangle': [2, 'never'] // 对象字面量项尾不能有逗号 }, parserOptions: { parser: 'babel-eslint' } }