Eslint的默认配置

module.exports = {
   
   
    root: true,
    env: {
   
   
      node: true
    },
    extends: [
      "plugin:vue/essential",
      "eslint:recommended",
      "@vue/typescript/recommended"
      // "@vue/prettier",
      // "@vue/prettier/@typescript-eslint"
    ],
    parserOptions: {
   
   
      ecmaVersion: 2020
    },
    rules: {
   
   
      'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
      'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
      '@typescript-eslint/no-explicit-any': ['off'], // 关闭any类型时的警告
      '@typescript-eslint/no-empty-function': ['off'], // 关闭空函数警告
      "@typescript-eslint/no-var-requires": [0],
      "@typescript-eslint/camelcase": ["off"], // 关闭词组下划线校验
      "@typescript-eslint/ban-ts-ignore": ["off"], // 允许使用ts-ignore
      
      'vue/max-attributes-per-line': [2, {
   
   
        'singleline': 10,
        'multiline': {
   
   
          'max': 1,
          'allowFirstLine': false
        }
      }],
      'vue/html-self-closing': [2, {
   
   
        'html': {
   
   
          'void': 'any',
          'normal': 'any',
          'component': 'any'
        },
        'svg': 'always',
        'math': 'always'
      }],
      'vue/name-property-casing': ['error', 'PascalCase'],
      'accessor-pairs': 2, // 强制 getter 和 setter 在对象中成对出现
      'arrow-spacing': [2, {
   
   
        'before': true,
        'after': true
      }], // 强制箭头函数的箭头前后使用一致的空格
      'block-spacing': [2, 'always'], // 禁止或强制在代码块中开括号前和闭括号后有空格
      'brace-style': [2, '1tbs', {
   
   
        'allowSingleLine': true
      }], // 强制在代码块中使用一致的大括号风格
      'camelcase': [0, {
   
   
        'properties': 'always'
      }]
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值