|
| 1 | +module.exports = { |
| 2 | + parser: '@typescript-eslint/parser', |
| 3 | + plugins: ['jest', 'react', '@typescript-eslint'], |
| 4 | + settings: { |
| 5 | + react: { |
| 6 | + version: '0.15.0', |
| 7 | + }, |
| 8 | + }, |
| 9 | + env: { |
| 10 | + browser: true, |
| 11 | + es6: true, |
| 12 | + node: true, |
| 13 | + jest: true, |
| 14 | + }, |
| 15 | + extends: ['prettier', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended'], |
| 16 | + parserOptions: { |
| 17 | + arrowFunctions: true, |
| 18 | + binaryLiterals: true, |
| 19 | + blockBindings: true, |
| 20 | + classes: true, |
| 21 | + defaultParams: true, |
| 22 | + destructuring: true, |
| 23 | + experimentalObjectRestSpread: true, |
| 24 | + forOf: true, |
| 25 | + generators: true, |
| 26 | + globalReturn: true, |
| 27 | + jsx: true, |
| 28 | + modules: true, |
| 29 | + objectLiteralComputedProperties: true, |
| 30 | + objectLiteralDuplicateProperties: true, |
| 31 | + objectLiteralShorthandMethods: true, |
| 32 | + objectLiteralShorthandProperties: true, |
| 33 | + octalLiterals: true, |
| 34 | + regexUFlag: true, |
| 35 | + regexYFlag: true, |
| 36 | + restParams: true, |
| 37 | + spread: true, |
| 38 | + superInFunctions: true, |
| 39 | + templateStrings: true, |
| 40 | + unicodeCodePointEscapes: true, |
| 41 | + }, |
| 42 | + rules: { |
| 43 | + 'react/jsx-boolean-value': 'error', |
| 44 | + 'react/jsx-handler-names': 'error', |
| 45 | + 'react/jsx-key': 'error', |
| 46 | + 'react/jsx-no-duplicate-props': 'error', |
| 47 | + 'react/jsx-no-literals': 'error', |
| 48 | + 'react/jsx-no-undef': 'error', |
| 49 | + 'react/jsx-pascal-case': 'error', |
| 50 | + 'react/jsx-uses-react': 'error', |
| 51 | + 'react/jsx-uses-vars': 'error', |
| 52 | + 'react/no-deprecated': 'error', |
| 53 | + 'react/no-did-mount-set-state': 'error', |
| 54 | + 'react/no-did-update-set-state': 'error', |
| 55 | + 'react/no-direct-mutation-state': 'error', |
| 56 | + 'react/no-string-refs': 'error', |
| 57 | + 'react/no-unknown-property': 'error', |
| 58 | + 'react/prop-types': [ |
| 59 | + 'error', |
| 60 | + { |
| 61 | + ignore: ['children'], |
| 62 | + }, |
| 63 | + ], |
| 64 | + 'react/prefer-es6-class': 'error', |
| 65 | + 'react/prefer-stateless-function': 'error', |
| 66 | + 'react/react-in-jsx-scope': 'error', |
| 67 | + 'react/self-closing-comp': 'error', |
| 68 | + 'react/sort-comp': [ |
| 69 | + 'error', |
| 70 | + { |
| 71 | + order: ['static-methods', 'lifecycle', 'render', 'everything-else'], |
| 72 | + }, |
| 73 | + ], |
| 74 | + // temporary |
| 75 | + 'react/no-find-dom-node': 'warn', |
| 76 | + 'no-constant-condition': 'error', |
| 77 | + 'no-control-regex': 'error', |
| 78 | + 'no-debugger': 'warn', |
| 79 | + 'no-dupe-args': 'error', |
| 80 | + 'no-dupe-keys': 'error', |
| 81 | + 'no-duplicate-case': 'error', |
| 82 | + 'no-empty': 'error', |
| 83 | + 'no-empty-character-class': 'error', |
| 84 | + 'no-ex-assign': 'error', |
| 85 | + 'no-extra-boolean-cast': 'error', |
| 86 | + 'no-func-assign': 'error', |
| 87 | + 'no-inner-declarations': ['error', 'functions'], |
| 88 | + 'no-invalid-regexp': 'error', |
| 89 | + 'no-irregular-whitespace': 'error', |
| 90 | + 'no-obj-calls': 'error', |
| 91 | + 'no-regex-spaces': 'error', |
| 92 | + 'no-sparse-arrays': 'error', |
| 93 | + 'no-unreachable': 'error', |
| 94 | + 'no-unsafe-negation': 'error', |
| 95 | + 'use-isnan': 'error', |
| 96 | + 'valid-typeof': 'error', |
| 97 | + 'block-scoped-var': 'off', |
| 98 | + complexity: 'off', |
| 99 | + 'consistent-return': 'off', |
| 100 | + curly: ['error', 'all'], |
| 101 | + 'default-case': 'off', |
| 102 | + 'dot-notation': 'off', |
| 103 | + eqeqeq: ['error', 'smart'], |
| 104 | + 'guard-for-in': 'error', |
| 105 | + 'no-alert': 'error', |
| 106 | + 'no-caller': 'error', |
| 107 | + 'no-div-regex': 'error', |
| 108 | + 'no-else-return': 'error', |
| 109 | + 'no-eq-null': 'off', |
| 110 | + 'no-eval': 'error', |
| 111 | + 'no-extend-native': 'error', |
| 112 | + 'no-extra-bind': 'error', |
| 113 | + 'no-fallthrough': 'error', |
| 114 | + 'no-global-assign': 'error', |
| 115 | + 'no-implicit-coercion': 'error', |
| 116 | + 'no-implied-eval': 'error', |
| 117 | + 'no-invalid-this': 'off', |
| 118 | + 'no-iterator': 'error', |
| 119 | + 'no-labels': [ |
| 120 | + 'error', |
| 121 | + { |
| 122 | + allowLoop: true, |
| 123 | + }, |
| 124 | + ], |
| 125 | + 'no-lone-blocks': 'error', |
| 126 | + 'no-loop-func': 'off', |
| 127 | + 'no-multi-str': 'error', |
| 128 | + 'no-new': 'error', |
| 129 | + 'no-new-func': 'off', |
| 130 | + 'no-new-wrappers': 'error', |
| 131 | + 'no-octal': 'error', |
| 132 | + 'no-octal-escape': 'error', |
| 133 | + 'no-param-reassign': 'error', |
| 134 | + 'no-proto': 'error', |
| 135 | + 'no-redeclare': 'error', |
| 136 | + 'no-return-assign': 'error', |
| 137 | + 'no-script-url': 'error', |
| 138 | + 'no-self-compare': 'off', |
| 139 | + 'no-sequences': 'error', |
| 140 | + 'no-throw-literal': 'error', |
| 141 | + 'no-unused-expressions': 'error', |
| 142 | + 'no-useless-call': 'error', |
| 143 | + 'no-useless-escape': 'error', |
| 144 | + 'no-useless-return': 'error', |
| 145 | + 'no-void': 'error', |
| 146 | + 'no-warning-comments': 'off', |
| 147 | + 'no-with': 'error', |
| 148 | + radix: 'error', |
| 149 | + 'vars-on-top': 'off', |
| 150 | + yoda: [ |
| 151 | + 'error', |
| 152 | + 'never', |
| 153 | + { |
| 154 | + exceptRange: true, |
| 155 | + }, |
| 156 | + ], |
| 157 | + strict: 'off', |
| 158 | + 'init-declarations': 'off', |
| 159 | + 'no-delete-var': 'error', |
| 160 | + 'no-label-var': 'error', |
| 161 | + 'no-shadow': 'error', |
| 162 | + 'no-shadow-restricted-names': 'error', |
| 163 | + 'no-undef': 'error', |
| 164 | + 'no-undef-init': 'error', |
| 165 | + 'no-undefined': 'off', |
| 166 | + 'no-unused-vars': [ |
| 167 | + 'error', |
| 168 | + { |
| 169 | + vars: 'all', |
| 170 | + args: 'after-used', |
| 171 | + argsIgnorePattern: '^_', |
| 172 | + }, |
| 173 | + ], |
| 174 | + 'no-use-before-define': 'off', |
| 175 | + 'callback-return': 'error', |
| 176 | + 'handle-callback-err': ['error', 'error'], |
| 177 | + 'no-mixed-requires': ['error', true], |
| 178 | + 'no-new-require': 'error', |
| 179 | + 'no-path-concat': 'error', |
| 180 | + 'no-process-env': 'off', |
| 181 | + 'no-process-exit': 'off', |
| 182 | + 'no-restricted-modules': 'off', |
| 183 | + 'no-sync': 'error', |
| 184 | + camelcase: [ |
| 185 | + 'error', |
| 186 | + { |
| 187 | + properties: 'always', |
| 188 | + }, |
| 189 | + ], |
| 190 | + 'consistent-this': 'off', |
| 191 | + 'func-names': 'off', |
| 192 | + 'func-style': 'off', |
| 193 | + 'id-length': 'off', |
| 194 | + 'id-match': ['error', '^(?:_?[a-zA-Z0-9]*)|[_A-Z0-9]+$'], |
| 195 | + 'lines-around-comment': 'off', |
| 196 | + 'max-depth': 'off', |
| 197 | + 'max-nested-callbacks': 'off', |
| 198 | + 'max-params': 'off', |
| 199 | + 'max-statements': 'off', |
| 200 | + 'new-cap': 'off', |
| 201 | + 'no-array-constructor': 'error', |
| 202 | + 'no-bitwise': 'off', |
| 203 | + 'no-continue': 'off', |
| 204 | + 'no-inline-comments': 'off', |
| 205 | + 'no-lonely-if': 'error', |
| 206 | + 'no-nested-ternary': 'off', |
| 207 | + 'no-new-object': 'error', |
| 208 | + 'no-plusplus': 'off', |
| 209 | + 'no-tabs': 'error', |
| 210 | + 'no-ternary': 'off', |
| 211 | + 'no-underscore-dangle': 'off', |
| 212 | + 'no-unneeded-ternary': 'error', |
| 213 | + 'one-var': ['error', 'never'], |
| 214 | + 'operator-assignment': ['error', 'always'], |
| 215 | + 'padding-line-between-statements': 'off', |
| 216 | + quotes: [ |
| 217 | + 'error', |
| 218 | + 'single', |
| 219 | + { |
| 220 | + avoidEscape: true, |
| 221 | + allowTemplateLiterals: true, |
| 222 | + }, |
| 223 | + ], |
| 224 | + 'sort-vars': 'off', |
| 225 | + 'spaced-comment': ['error', 'always'], |
| 226 | + 'no-class-assign': 'error', |
| 227 | + 'no-const-assign': 'error', |
| 228 | + 'no-this-before-super': 'error', |
| 229 | + 'no-var': 'error', |
| 230 | + 'object-shorthand': ['error', 'always'], |
| 231 | + 'prefer-arrow-callback': 'error', |
| 232 | + 'prefer-const': 'error', |
| 233 | + 'prefer-spread': 'off', |
| 234 | + 'require-yield': 'error', |
| 235 | + 'array-bracket-newline': 'off', |
| 236 | + 'array-bracket-spacing': 'off', |
| 237 | + 'array-element-newline': 'off', |
| 238 | + 'arrow-parens': 'off', |
| 239 | + 'arrow-spacing': 'off', |
| 240 | + 'block-spacing': 'off', |
| 241 | + 'brace-style': 'off', |
| 242 | + 'comma-dangle': 'off', |
| 243 | + 'comma-spacing': 'off', |
| 244 | + 'comma-style': 'off', |
| 245 | + 'computed-property-spacing': 'off', |
| 246 | + 'dot-location': 'off', |
| 247 | + 'eol-last': 'off', |
| 248 | + 'func-call-spacing': 'off', |
| 249 | + 'function-paren-newline': 'off', |
| 250 | + 'generator-star-spacing': 'off', |
| 251 | + 'implicit-arrow-linebreak': 'off', |
| 252 | + indent: 'off', |
| 253 | + 'jsx-quotes': 'off', |
| 254 | + 'key-spacing': 'off', |
| 255 | + 'keyword-spacing': 'off', |
| 256 | + 'linebreak-style': 'error', |
| 257 | + 'max-len': 'off', |
| 258 | + 'multiline-ternary': 'off', |
| 259 | + 'newline-per-chained-call': 'off', |
| 260 | + 'new-parens': 'off', |
| 261 | + 'no-confusing-arrow': 'off', |
| 262 | + 'no-extra-parens': 'off', |
| 263 | + 'no-extra-semi': 'off', |
| 264 | + 'no-floating-decimal': 'off', |
| 265 | + 'no-mixed-operators': 'off', |
| 266 | + 'no-mixed-spaces-and-tabs': 'off', |
| 267 | + 'no-multi-spaces': 'off', |
| 268 | + 'no-multiple-empty-lines': 'off', |
| 269 | + 'no-spaced-func': 'off', |
| 270 | + 'no-trailing-spaces': 'off', |
| 271 | + 'no-unexpected-multiline': 'error', |
| 272 | + 'no-whitespace-before-property': 'off', |
| 273 | + 'nonblock-statement-body-position': 'off', |
| 274 | + 'object-curly-newline': 'off', |
| 275 | + 'object-curly-spacing': [0, 'always'], |
| 276 | + 'object-property-newline': 'off', |
| 277 | + 'one-var-declaration-per-line': 'off', |
| 278 | + 'operator-linebreak': 'off', |
| 279 | + 'padded-blocks': 'off', |
| 280 | + 'quote-props': 'off', |
| 281 | + 'rest-spread-spacing': 'off', |
| 282 | + semi: 'off', |
| 283 | + 'semi-spacing': 'off', |
| 284 | + 'semi-style': 'off', |
| 285 | + 'space-before-blocks': 'off', |
| 286 | + 'space-before-function-paren': 'off', |
| 287 | + 'space-in-parens': 'off', |
| 288 | + 'space-infix-ops': 'off', |
| 289 | + 'space-unary-ops': 'off', |
| 290 | + 'switch-colon-spacing': 'off', |
| 291 | + 'template-curly-spacing': 'off', |
| 292 | + 'template-tag-spacing': 'off', |
| 293 | + 'unicode-bom': 'off', |
| 294 | + 'wrap-iife': 'off', |
| 295 | + 'wrap-regex': 'off', |
| 296 | + 'yield-star-spacing': 'off', |
| 297 | + }, |
| 298 | +}; |
0 commit comments