UNPKG

1.61 kBJavaScriptView Raw
1const OFF = 0;
2const WARNING = 1;
3const ERROR = 2;
4
5module.exports = {
6 env: {
7 browser: true,
8 commonjs: true,
9 jest: true,
10 node: true,
11 },
12 parser: 'babel-eslint',
13 extends: ['airbnb', 'prettier'],
14 rules: {
15 'no-console': OFF, // We have console.error, console.warn, etc.
16 radix: ERROR,
17 'class-methods-use-this': OFF,
18 'func-names': OFF,
19 'no-empty': [ERROR, {allowEmptyCatch: true}],
20 'no-param-reassign': OFF,
21 'no-plusplus': OFF,
22 'prefer-template': OFF,
23 'import/no-extraneous-dependencies': OFF,
24 'react/jsx-closing-bracket-location': OFF, // Formatting is left to Prettier.
25 'react/jsx-filename-extension': OFF, // Enable in future when migrating.
26 'react/jsx-one-expression-per-line': OFF, // Formatting is left to Prettier.
27 'react/no-array-index-key': OFF, // It's ok if you use it for static content.
28 'react/no-danger': OFF, // Need this to inject scripts.
29 'react/no-multi-comp': OFF, // One component per file creates too many files.
30 'react/no-unescaped-entities': [ERROR, {forbid: ['>', '}']}],
31
32 // Existing ESLint errors sorted by frequency, silencing first.
33 'react/button-has-type': OFF, // 1
34 'react/forbid-prop-types': OFF, // 1
35 'react/require-default-props': OFF, // 1
36 'jsx-a11y/anchor-is-valid': OFF, // 9
37 'import/no-unresolved': OFF, // 15
38 'react/prefer-stateless-function': OFF, // 22
39 'import/no-dynamic-require': OFF, // 46
40 'prefer-destructuring': OFF, // 69
41 'global-require': OFF, // 85
42 'react/prop-types': OFF, // 197
43 'react/destructuring-assignment': OFF, // 342
44 },
45};