| | |
| | | module.exports = { |
| | | env: { |
| | | browser: true, |
| | | node: true |
| | | es2021: true |
| | | }, |
| | | extends: [ |
| | | // 参考vuejs官方的eslint配置: https://eslint.vuejs.org/user-guide/#usage |
| | | 'plugin:vue/recommended', |
| | | // 覆盖 ESLint 配置,确保 prettier 放在最后 |
| | | 'eslint:recommended' |
| | | extends: ['standard', 'plugin:vue/recommended'], |
| | | overrides: [ |
| | | { |
| | | env: { |
| | | node: true |
| | | }, |
| | | files: ['.eslintrc.{js,cjs}'], |
| | | parserOptions: { |
| | | sourceType: 'script' |
| | | } |
| | | } |
| | | ], |
| | | parserOptions: { |
| | | ecmaVersion: 10, |
| | | sourceType: 'module' |
| | | ecmaVersion: 2021, |
| | | sourceType: 'module', |
| | | parser: 'babel-eslint', |
| | | ecmaFeatures: { |
| | | // 非 react 项目关闭 jsx 语法校验,默认为 true |
| | | jsx: false |
| | | } |
| | | }, |
| | | globals: { |
| | | AMap: true, |
| | | AMapUI: true |
| | | }, |
| | | plugins: ['vue'], |
| | | rules: { |
| | | 'space-before-function-paren': 0, |
| | | 'no-console': 'off', |
| | | 'no-unused-vars': 'off', |
| | | 'vue/attribute-hyphenation': 0 // 忽略属性连字 |
| | | 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', |
| | | 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', |
| | | camelcase: 'off', |
| | | 'comma-dangle': 'off', |
| | | '@typescript-eslint/no-explicit-any': 'off', |
| | | '@typescript-eslint/camelcase': 'off', |
| | | '@typescript-eslint/no-empty-function': 'off', |
| | | 'lines-between-class-members': 'off', |
| | | '@typescript-eslint/no-this-alias': 'off' |
| | | } |
| | | } |