.eslintrc.js 1008 字节
Newer Older
B
binaryify 已提交
1
module.exports = {
A
a632079 已提交
2 3 4 5
  root: true,
  parserOptions: {
    parser: 'babel-eslint',
    ecmaVersion: 2018,
A
a632079 已提交
6
    sourceType: 'module',
A
a632079 已提交
7 8
  },
  plugins: ['html'],
A
a632079 已提交
9
  extends: ['plugin:prettier/recommended'],
A
a632079 已提交
10 11
  env: {
    browser: true,
A
a632079 已提交
12
    node: true,
A
a632079 已提交
13
  },
B
binaryify 已提交
14

A
a632079 已提交
15 16 17 18 19 20 21
  rules: {
    indent: ['error', 2, { SwitchCase: 1 }],
    'space-infix-ops': ['error', { int32Hint: false }],
    'key-spacing': [
      2,
      {
        beforeColon: false,
A
a632079 已提交
22 23
        afterColon: true,
      },
A
a632079 已提交
24 25 26 27 28 29 30 31 32 33 34
    ],
    'no-octal': 2,
    'no-redeclare': 2,
    'comma-spacing': 2,
    'no-new-object': 2,
    'arrow-spacing': 2,
    quotes: [
      2,
      'single',
      {
        avoidEscape: true,
A
a632079 已提交
35 36 37
        allowTemplateLiterals: true,
      },
    ],
A
a632079 已提交
38 39 40 41 42 43
  },
  overrides: [
    {
      files: ['**/*.ts'],
      parser: '@typescript-eslint/parser',
      extends: [
A
a632079 已提交
44
        'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
B
binaryify 已提交
45
        // 'prettier/@typescript-eslint',
A
a632079 已提交
46
      ],
A
a632079 已提交
47 48
    },
  ],
B
binaryify 已提交
49
}