{"size": 2425, "ext": "js", "max_stars_repo_path": "packages/eslint-config/rules/es.js", "max_stars_repo_name": "FringeY/alibabacloud-console-base", "max_stars_repo_stars_event_min_datetime": "2019-11-18T14:10:56.000Z", "max_stars_repo_stars_event_max_datetime": "2020-10-20T13:04:59.000Z", "max_issues_repo_path": "packages/eslint-config/rules/es.js", "max_issues_repo_name": "FringeY/alibabacloud-console-base", "max_issues_repo_issues_event_min_datetime": "2020-12-03T03:56:22.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-24T04:38:50.000Z", "max_forks_repo_path": "packages/eslint-config/rules/es.js", "max_forks_repo_name": "FringeY/alibabacloud-console-base", "max_forks_repo_forks_event_min_datetime": "2021-03-28T04:41:55.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-07T11:05:00.000Z"}
{"max_stars_count": 21, "max_issues_count": 9, "max_forks_count": 6, "avg_line_length": 21.6517857143, "max_line_length": 124, "alphanum_fraction": 0.5558762887}
// es5/6 通用
module.exports = {
  /*
   * 80 - 100 太小了
   */
  'max-len': ['warn', 200, 2, {
    ignorePattern: 'data:image/\\w+;base64,',
    ignoreComments: false,
    ignoreTrailingComments: true,
    ignoreUrls: true,
    ignoreStrings: true,
    ignoreRegExpLiterals: true,
    ignoreTemplateLiterals: true
  }],
  /*
   * eslint-config-ali 用的是 multi-line，且说「多行语句必须用大括号包裹，单行语句推荐用大括号包裹」
   * 但这会导致不一致，且容易在增加代码的时候出错，所以全加
   */
  curly: ['error', 'all'],
  /*
   * 这条规则其实可以提高代码的可理解度，但 eslint-config-ali 把它关了
   * https://eslint.org/docs/rules/no-else-return
   */
  'no-else-return': ['warn', {
    allowElseIf: false
  }],
  /**
   * 不认为现代的编译器还需要这个
   */
  'eol-last': 'off',
  /*
   * 不论 es5 还是 es6 都不要加额外的逗号，额外的逗号会产生代码风格上的歧义，比如一个对象在写成一行的时候可能如下：
   * 
   * ```
   * { key1: value1, key2: value2 }
   * ```
   * 
   * 而写成多行的时候，会被要求
   * 
   * ```
   * {
   *   key1: value1,
   *   key2: value2,
   * }
   * ```
   * 
   * 所以不要有多余的逗号，那并不属于代码
   */
  'comma-dangle': [
    'error',
    'never'
  ],
  'comma-spacing': ['error', {
    before: false,
    after: true
  }],
  /**
   * eslint-config-ali 把 props 设成了 true，然后加了 ignorePropertyModificationsFor 配置（在我看来 ignorePropertyModificationsFor 只能应用层级来陪）
   */
  'no-param-reassign': ['warn', {
    props: false
  }],
  'no-trailing-spaces': ['error', {
    skipBlankLines: true,
    ignoreComments: true
  }],
  /*
   * anonymous: always -> never
   * 
   * https://eslint.org/docs/rules/space-before-function-paren
   */
  'space-before-function-paren': ['error', {
    anonymous: 'never', // eslint-config-ali 为 'always'
    named: 'never',
    asyncArrow: 'always'
  }],
  'spaced-comment': ['error', 'always'],
  indent: ['error', 2, {
    SwitchCase: 1,
    ArrayExpression: 1,
    MemberExpression: 2,
    CallExpression: {
      arguments: 2
    },
    FunctionExpression: {
      body: 1,
      parameters: 2
    },
    FunctionDeclaration: {
      body: 1,
      parameters: 2
    }
  }],
  'padding-line-between-statements': ['error', {
    blankLine: 'always',
    prev: ['const', 'let', 'var', 'if', 'for', 'while', 'switch', 'try'],
    next: '*'
  }, {
    blankLine: 'any',
    prev: ['const', 'let', 'var'],
    next: ['const', 'let', 'var']
  }, {
    blankLine: 'always',
    prev: '*',
    next: ['return', 'throw', 'break', 'continue', 'if', 'for', 'while', 'switch', 'try']
  }],
  'no-multiple-empty-lines': ['error', {
    max: 1,
    maxEOF: 1
  }]
};
