module.exports = {
  root: true,
  env: {
    browser: true,
    es2022: true,
  },
  extends: ['plugin:vue/essential', 'airbnb-base'],
  parser: '@babel/eslint-parser',
  rules: {
    'max-classes-per-file': [
      'error',
      {
        ignoreExpressions: true,
        max: 2,
      },
    ],
    'no-restricted-syntax': ['error', "BinaryExpression[operator='in']"],
    'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    'linebreak-style': ['off', 'windows'],
    'vue/multi-word-component-names': 'off',
    'max-len': [
      'error',
      {
        code: 120,
        ignoreUrls: true,
      },
    ],
    'guard-for-in': 'off',
    'no-underscore-dangle': 'off',
    'no-plusplus': [
      'error',
      { allowForLoopAfterthoughts: true },
    ],
    'no-unused-vars': [
      'error',
      { args: 'none' },
    ],
    'no-unused-expressions': [
      'error',
      { allowShortCircuit: true },
    ],
    'lines-between-class-members': [
      'error',
      'always',
      { exceptAfterSingleLine: true },
    ],
    'arrow-body-style': ['error', 'as-needed', { requireReturnForObjectLiteral: true }],
    // 对象括号换行
    'object-curly-newline': [
      'error',
      { ObjectExpression: { multiline: true } },
    ],
  },
};
