/* eslint-env node */
module.exports = {
  env: {
    browser: true,
    es2021: true,
    node: true,
    'vue/setup-compiler-macros': true
  },
  extends: ['plugin:vue/vue3-essential', 'airbnb-base', 'plugin:prettier/recommended', './.eslintrc-auto-import.json'],
  parserOptions: {
    ecmaVersion: 12,
    parser: '@typescript-eslint/parser',
    sourceType: 'module'
  },
  plugins: ['vue', '@typescript-eslint'],
  rules: {
    'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
    eqeqeq: ['error', 'always'],
    'no-empty': 'off',
    'import/prefer-default-export': 'off',
    'import/no-unresolved': 'off',
    'import/extensions': 'off',
    'import/no-absolute-path': 'off',
    'import/no-extraneous-dependencies': 'off',
    'vue/no-multiple-template-root': 'off',
    'no-console': 'off',
    'vue/multi-word-component-names': 'off',
    'no-param-reassign': 'off',
    'vue/no-v-model-argument': 'off',
    'consistent-return': 'off',
    'vue/no-unused-vars': 'off',
    'vue/no-reserved-keys': 'off',
    'vue/no-unused-components': 'off',
    'vue/no-use-v-if-with-v-for': 'off',
    '@typescript-eslint/no-unused-vars': 'off',
    'spaced-comment': 'off',
    // 关闭一些过于严格的规则
    'no-use-before-define': 'off',
    'class-methods-use-this': 'off',
    'no-restricted-syntax': 'off',
    'no-restricted-globals': 'off',
    'prefer-destructuring': 'off',
    'no-plusplus': 'off'
  },
  ignorePatterns: [
    'package.json',
    'tsconfig.json',
    'tsconfig.app.json',
    'tsconfig.node.json',
    'tsconfig.test.json',
    'vite.config.ts',
    'vitest.config.ts',
    'playwright.config.ts'
  ],
  globals: {
    ref: 'readonly',
    reactive: 'readonly',
    computed: 'readonly',
    watch: 'readonly',
    watchEffect: 'readonly',
    onMounted: 'readonly',
    onUnmounted: 'readonly',
    defineProps: 'readonly',
    defineEmits: 'readonly',
    defineExpose: 'readonly',
    withDefaults: 'readonly',
    ElMessage: 'readonly',
    ElMessageBox: 'readonly',
    __APP_VERSION__: 'readonly'
  }
}
