// module.exports = { // root: true, // env: { // node: true // }, // 'extends': [ // // 'plugin:vue/essential', // // 'eslint:recommended' // 'standard', //使用standard做代码规范 // "prettier", // ], // parserOptions: { // parser: 'babel-eslint' // }, // rules: { // 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', // 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', // //强制使用单引号 // "prettier/prettier": "error", // quotes: ['error', 'single'], // //强制不使用分号结尾 // semi: ['error', 'never'] // } // } module.exports = { root: true, parserOptions: { parser: 'babel-eslint' }, env: { browser: true, es6: true }, extends: [ // https://github.com/standard/standard/blob/master/docs/RULES-en.md 'standard', // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. 'plugin:vue/essential', 'plugin:prettier/recommended' ], // required to lint *.vue files plugins: ['vue'], // add your custom rules here rules: { 'prettier/prettier': 'error', // allow async-await 'generator-star-spacing': 'off', // allow debugger during development 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', quotes: ['error', 'single'], // 强制不使用分号结尾 semi: ['error', 'never'] } /*, settings: { "import/resolver": { "webpack": { //此处config对应webpack.config.js的路径,我这个路径是vue-cli3默认的路径 "config": "node_modules/@vue/cli-service/webpack.config.js" } } } */ }