-
Notifications
You must be signed in to change notification settings - Fork 6
/
.eslintrc.js
81 lines (65 loc) · 2.12 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module'
},
extends: ['plugin:prettier/recommended'],
plugins: ['prettier'],
env: {
browser: true,
node: true
},
rules: {
// No console or debugger lines in production. Warn in dev, to make it
// easier to identify them.
'no-console': process.env.NODE_ENV === 'production' ? 2 : 1,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 1,
// ES6 let and const don't hoist variables, so it is an error to use them
// before they are defined. However, without a good function definition/declaration
// distinction trying to get definition order correct is ugly at best.
'no-use-before-define': ['error', { functions: false }],
// Don't allow trailing commas (e.g. ['a',]).
'comma-dangle': ['error', 'never'],
// Enforce use of === for comparisons.
eqeqeq: 'error',
// Keep spacing around function parens consistent.
'space-before-function-paren': [
'error',
{
anonymous: 'never',
named: 'never',
asyncArrow: 'always'
}
],
// Don't allow reassigning function paramaters.
'no-param-reassign': 'error',
// Allow omitting parens when there is only one argument to an arrow function.
'arrow-parens': ['error', 'as-needed'],
// Require all immediately-invoked function expressions to be outside parentheses.
'wrap-iife': ['error', 'inside'],
// util.js has a wrapper class around some deprecated functions named the same.
// Once those have been removed we can turn this error back on.
'import/no-named-as-default-member': 'off',
// We don't actually use JSX, but airbnb does. And there is a bug with
// this option in the current eslint/npm versions.
'jsx-a11y/href-no-hash': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'max-len': [
'error',
{
code: 120,
ignoreComments: true
}
]
},
overrides: [
{
files: ['__tests__/**/*.ts'],
rules: {
'no-console': 'off',
'max-len': 'off'
}
}
]
};