| | |
| | | module.exports = { |
| | | root: true, |
| | | env: { |
| | | browser: true, |
| | | node: true, |
| | | es6: true |
| | | es2021: true |
| | | }, |
| | | extends: ['plugin:vue/essential', '@vue/standard'], |
| | | extends: ['eslint:recommended', 'standard'], |
| | | overrides: [ |
| | | { |
| | | env: { |
| | | node: true |
| | | }, |
| | | files: ['.eslintrc.{js,cjs}'], |
| | | parserOptions: { |
| | | sourceType: 'script' |
| | | } |
| | | } |
| | | ], |
| | | parserOptions: { |
| | | ecmaVersion: '12', |
| | | sourceType: 'module' |
| | | }, |
| | | plugins: ['vue'], |
| | | rules: { |
| | | eqeqeq: ['error', 'always'], // 强制使用三个等于号 |
| | | semi: 2, // 语句可以不需要分号结尾 |
| | |
| | | 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', |
| | | 'no-unused-vars': 0, // 禁止出现未使用过的变量 |
| | | 'spaced-comment': 0 // 强制在注释中 // 或 /* 使用一致的空格 |
| | | }, |
| | | parserOptions: { |
| | | ecmaVersion: 6, |
| | | parser: 'babel-eslint' |
| | | }, |
| | | plugins: ['vue'] |
| | | } |
| | | } |