|
| 1 | +module.exports = { |
| 2 | + extends: [ |
| 3 | + 'eslint:recommended', |
| 4 | + 'plugin:promise/recommended', |
| 5 | + ], |
| 6 | + parser: 'babel-eslint', |
| 7 | + parserOptions: { |
| 8 | + parser: 'babel-eslint', |
| 9 | + ecmaVersion: 2017, |
| 10 | + sourceType: 'module', |
| 11 | + allowImportExportEverywhere: true, |
| 12 | + }, |
| 13 | + env: { |
| 14 | + amd: true, |
| 15 | + node: true, |
| 16 | + }, |
| 17 | + ignorePatterns: [ |
| 18 | + '**/public/**/*', |
| 19 | + '**/dist/**/*', |
| 20 | + '**/node_modules/**/*', |
| 21 | + '**/vendor/**/*', |
| 22 | + ], |
| 23 | + rules: { |
| 24 | + 'indent': ['error', 4, { 'SwitchCase': 1, 'MemberExpression': 1 }], |
| 25 | + 'no-trailing-spaces': 'error', |
| 26 | + 'no-console': process.env.NODE_ENV === 'production' ? [ |
| 27 | + 'error', |
| 28 | + { 'allow': ['warn', 'error'] }, |
| 29 | + ] : 'off', |
| 30 | + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', |
| 31 | + 'no-fallthrough': 'off', |
| 32 | + 'no-case-declarations': 'off', |
| 33 | + 'space-before-function-paren': 'error', |
| 34 | + 'spaced-comment': 'error', |
| 35 | + 'arrow-spacing': 'error', |
| 36 | + 'key-spacing': [2, {'beforeColon': false, 'afterColon': true}], |
| 37 | + 'keyword-spacing': 'error', |
| 38 | + 'semi': ['error', 'always'], |
| 39 | + 'dot-location': ['error', 'property'], |
| 40 | + 'dot-notation': 'error', |
| 41 | + 'no-alert': 'off', |
| 42 | + 'eqeqeq': ['error', 'always'], |
| 43 | + 'no-floating-decimal': 'error', |
| 44 | + 'no-global-assign': 'error', |
| 45 | + 'no-multi-spaces': 'error', |
| 46 | + 'no-useless-return': 'error', |
| 47 | + 'no-undef-init': 'warn', |
| 48 | + 'no-use-before-define': ['error', { 'functions': false }], |
| 49 | + 'array-bracket-newline': ['error', 'consistent'], |
| 50 | + 'brace-style': ['error', '1tbs'], |
| 51 | + 'comma-dangle': ['error', 'always-multiline'], |
| 52 | + 'comma-spacing': 'error', |
| 53 | + 'comma-style': 'error', |
| 54 | + 'eol-last': 'error', |
| 55 | + 'func-call-spacing': 'error', |
| 56 | + 'quotes': ['error', 'single', { 'allowTemplateLiterals': true }], |
| 57 | + 'quote-props': ['error', 'as-needed'], |
| 58 | + 'linebreak-style': 'warn', |
| 59 | + 'lines-around-comment': 'warn', |
| 60 | + 'max-depth': ['error', 3], |
| 61 | + 'max-statements-per-line': 'error', |
| 62 | + 'newline-per-chained-call': 'error', |
| 63 | + 'no-lonely-if': 'error', |
| 64 | + 'no-mixed-operators': 'warn', |
| 65 | + 'no-multiple-empty-lines': ['error', { 'max': 1, 'maxEOF': 0, 'maxBOF': 0 }], |
| 66 | + 'no-tabs': 'warn', |
| 67 | + 'space-before-blocks': 'error', |
| 68 | + 'space-infix-ops': 'error', |
| 69 | + 'space-unary-ops': [2, { |
| 70 | + 'words': true, |
| 71 | + 'nonwords': true, |
| 72 | + 'overrides': { |
| 73 | + '-': false, |
| 74 | + '++': false, |
| 75 | + '--': false, |
| 76 | + }, |
| 77 | + }], |
| 78 | + 'space-in-parens': 'error', |
| 79 | + 'switch-colon-spacing': 'error', |
| 80 | + 'arrow-body-style': 'error', |
| 81 | + 'no-duplicate-imports': 'warn', |
| 82 | + 'no-useless-computed-key': 'warn', |
| 83 | + 'no-var': 'error', |
| 84 | + 'arrow-parens': ['error', 'as-needed'], |
| 85 | + 'curly': 'error', |
| 86 | + 'object-curly-spacing': ['error', 'always'], |
| 87 | + 'require-atomic-updates': 'off', |
| 88 | + 'no-prototype-builtins': 'off', |
| 89 | + 'object-shorthand': ['error', 'always'], |
| 90 | + 'promise/prefer-await-to-then': 'error', |
| 91 | + }, |
| 92 | +}; |
0 commit comments