|
| 1 | +module.exports = { |
| 2 | + root: true, |
| 3 | + env: { |
| 4 | + browser: true, |
| 5 | + node: true, |
| 6 | + es6: true, |
| 7 | + }, |
| 8 | + |
| 9 | + // add your custom rules here |
| 10 | + rules: { |
| 11 | + 'accessor-pairs': 2, |
| 12 | + 'arrow-spacing': [2, { |
| 13 | + 'before': true, |
| 14 | + 'after': true |
| 15 | + }], |
| 16 | + 'block-spacing': [2, 'always'], |
| 17 | + 'brace-style': [2, '1tbs', { |
| 18 | + 'allowSingleLine': true |
| 19 | + }], |
| 20 | + 'camelcase': [0, { |
| 21 | + 'properties': 'always' |
| 22 | + }], |
| 23 | + 'comma-dangle': [2, 'never'], |
| 24 | + 'comma-spacing': [2, { |
| 25 | + 'before': false, |
| 26 | + 'after': true |
| 27 | + }], |
| 28 | + 'comma-style': [2, 'last'], |
| 29 | + 'constructor-super': 2, |
| 30 | + 'curly': [2, 'multi-line'], |
| 31 | + 'dot-location': [2, 'property'], |
| 32 | + 'eol-last': 2, |
| 33 | + 'eqeqeq': ["error", "always", {"null": "ignore"}], |
| 34 | + 'generator-star-spacing': [2, { |
| 35 | + 'before': true, |
| 36 | + 'after': true |
| 37 | + }], |
| 38 | + 'handle-callback-err': [2, '^(err|error)$'], |
| 39 | + 'indent': [2, 2, { |
| 40 | + 'SwitchCase': 1 |
| 41 | + }], |
| 42 | + 'jsx-quotes': [2, 'prefer-single'], |
| 43 | + 'key-spacing': [2, { |
| 44 | + 'beforeColon': false, |
| 45 | + 'afterColon': true |
| 46 | + }], |
| 47 | + 'keyword-spacing': [2, { |
| 48 | + 'before': true, |
| 49 | + 'after': true |
| 50 | + }], |
| 51 | + 'new-cap': [2, { |
| 52 | + 'newIsCap': true, |
| 53 | + 'capIsNew': false |
| 54 | + }], |
| 55 | + 'new-parens': 2, |
| 56 | + 'no-array-constructor': 2, |
| 57 | + 'no-caller': 2, |
| 58 | + 'no-console': 'off', |
| 59 | + 'no-class-assign': 2, |
| 60 | + 'no-cond-assign': 2, |
| 61 | + 'no-const-assign': 2, |
| 62 | + 'no-control-regex': 0, |
| 63 | + 'no-delete-var': 2, |
| 64 | + 'no-dupe-args': 2, |
| 65 | + 'no-dupe-class-members': 2, |
| 66 | + 'no-dupe-keys': 2, |
| 67 | + 'no-duplicate-case': 2, |
| 68 | + 'no-empty-character-class': 2, |
| 69 | + 'no-empty-pattern': 2, |
| 70 | + 'no-eval': 2, |
| 71 | + 'no-ex-assign': 2, |
| 72 | + 'no-extend-native': 2, |
| 73 | + 'no-extra-bind': 2, |
| 74 | + 'no-extra-boolean-cast': 2, |
| 75 | + 'no-extra-parens': [2, 'functions'], |
| 76 | + 'no-fallthrough': 2, |
| 77 | + 'no-floating-decimal': 2, |
| 78 | + 'no-func-assign': 2, |
| 79 | + 'no-implied-eval': 2, |
| 80 | + 'no-inner-declarations': [2, 'functions'], |
| 81 | + 'no-invalid-regexp': 2, |
| 82 | + 'no-irregular-whitespace': 2, |
| 83 | + 'no-iterator': 2, |
| 84 | + 'no-label-var': 2, |
| 85 | + 'no-labels': [2, { |
| 86 | + 'allowLoop': false, |
| 87 | + 'allowSwitch': false |
| 88 | + }], |
| 89 | + 'no-lone-blocks': 2, |
| 90 | + 'no-mixed-spaces-and-tabs': 2, |
| 91 | + 'no-multi-spaces': 2, |
| 92 | + 'no-multi-str': 2, |
| 93 | + 'no-multiple-empty-lines': [2, { |
| 94 | + 'max': 1 |
| 95 | + }], |
| 96 | + 'no-native-reassign': 2, |
| 97 | + 'no-negated-in-lhs': 2, |
| 98 | + 'no-new-object': 2, |
| 99 | + 'no-new-require': 2, |
| 100 | + 'no-new-symbol': 2, |
| 101 | + 'no-new-wrappers': 2, |
| 102 | + 'no-obj-calls': 2, |
| 103 | + 'no-octal': 2, |
| 104 | + 'no-octal-escape': 2, |
| 105 | + 'no-path-concat': 2, |
| 106 | + 'no-proto': 2, |
| 107 | + 'no-redeclare': 2, |
| 108 | + 'no-regex-spaces': 2, |
| 109 | + 'no-return-assign': [2, 'except-parens'], |
| 110 | + 'no-self-assign': 2, |
| 111 | + 'no-self-compare': 2, |
| 112 | + 'no-sequences': 2, |
| 113 | + 'no-shadow-restricted-names': 2, |
| 114 | + 'no-spaced-func': 2, |
| 115 | + 'no-sparse-arrays': 2, |
| 116 | + 'no-this-before-super': 2, |
| 117 | + 'no-throw-literal': 2, |
| 118 | + 'no-trailing-spaces': 2, |
| 119 | + 'no-undef': 2, |
| 120 | + 'no-undef-init': 2, |
| 121 | + 'no-unexpected-multiline': 2, |
| 122 | + 'no-unmodified-loop-condition': 2, |
| 123 | + 'no-unneeded-ternary': [2, { |
| 124 | + 'defaultAssignment': false |
| 125 | + }], |
| 126 | + 'no-unreachable': 2, |
| 127 | + 'no-unsafe-finally': 2, |
| 128 | + 'no-unused-vars': [2, { |
| 129 | + 'vars': 'all', |
| 130 | + 'args': 'none' |
| 131 | + }], |
| 132 | + 'no-useless-call': 2, |
| 133 | + 'no-useless-computed-key': 2, |
| 134 | + 'no-useless-constructor': 2, |
| 135 | + 'no-useless-escape': 0, |
| 136 | + 'no-whitespace-before-property': 2, |
| 137 | + 'no-with': 2, |
| 138 | + 'one-var': [2, { |
| 139 | + 'initialized': 'never' |
| 140 | + }], |
| 141 | + 'operator-linebreak': [2, 'after', { |
| 142 | + 'overrides': { |
| 143 | + '?': 'before', |
| 144 | + ':': 'before' |
| 145 | + } |
| 146 | + }], |
| 147 | + 'padded-blocks': [2, 'never'], |
| 148 | + 'quotes': [2, 'single', { |
| 149 | + 'avoidEscape': true, |
| 150 | + 'allowTemplateLiterals': true |
| 151 | + }], |
| 152 | + 'semi': [2, 'never'], |
| 153 | + 'semi-spacing': [2, { |
| 154 | + 'before': false, |
| 155 | + 'after': true |
| 156 | + }], |
| 157 | + 'space-before-blocks': [2, 'always'], |
| 158 | + 'space-before-function-paren': [2, 'never'], |
| 159 | + 'space-in-parens': [2, 'never'], |
| 160 | + 'space-infix-ops': 2, |
| 161 | + 'space-unary-ops': [2, { |
| 162 | + 'words': true, |
| 163 | + 'nonwords': false |
| 164 | + }], |
| 165 | + 'spaced-comment': [2, 'always', { |
| 166 | + 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] |
| 167 | + }], |
| 168 | + 'template-curly-spacing': [2, 'never'], |
| 169 | + 'use-isnan': 2, |
| 170 | + 'valid-typeof': 2, |
| 171 | + 'wrap-iife': [2, 'any'], |
| 172 | + 'yield-star-spacing': [2, 'both'], |
| 173 | + 'yoda': [2, 'never'], |
| 174 | + 'prefer-const': 2, |
| 175 | + 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, |
| 176 | + 'object-curly-spacing': [2, 'always', { |
| 177 | + objectsInObjects: false |
| 178 | + }], |
| 179 | + 'array-bracket-spacing': [2, 'never'] |
| 180 | + } |
| 181 | +} |
0 commit comments