-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.cjs
54 lines (54 loc) · 1.98 KB
/
.eslintrc.cjs
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
module.exports = {
ignorePatterns: ['**/*.ignore.js', '**/*.ignore/*'],
extends: 'airbnb-base',
env: {
node: true,
es6: true,
},
parserOptions: {
ecmaVersion: 'latest',
},
rules: {
camelcase: ['warn', { ignoreGlobals: true }],
// Allow this behavior, but want to be aware of any possible issues
'consistent-return': 'warn',
'lines-between-class-members': ['error', 'always', {
exceptAfterSingleLine: true,
}],
// Allow modification of properties
'no-param-reassign': ['warn', { props: false }],
// Allow short circuits: test && action
'no-unused-expressions': ['error', { allowShortCircuit: true }],
// Allow function arguments to be unused
'no-unused-vars': ['error', { args: 'none' }],
// Allow functions to be defined after references (functions are top-level)
'no-use-before-define': ['error', 'nofunc'],
// Deconstruction not required when assigning to object properties (declared_var = object.key)
'prefer-destructuring': ['error', {
AssignmentExpression: { array: true, object: false },
}],
// Allow for loops to use unary (++/--)
'no-plusplus': ['warn', { allowForLoopAfterthoughts: true }],
'prefer-arrow-callback': ['error', { allowNamedFunctions: true }],
'no-useless-return': 'warn',
'class-methods-use-this': 'off',
'no-restricted-globals': ['error', ''],
'no-bitwise': 'off',
'no-mixed-operators': 'off',
'import/no-mutable-exports': 'warn',
'no-continue': 'off',
'object-curly-newline': ['error', { multiline: true, consistent: true }],
'operator-linebreak': ['error', 'after'],
quotes: ['error', 'single', { allowTemplateLiterals: true, avoidEscape: true }],
'no-extra-boolean-cast': 'warn',
'import/extensions': ['error', 'ignorePackages'],
'max-len': ['error', {
code: 120,
ignoreComments: true,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
tabWidth: 2,
}],
},
};