-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.js
91 lines (90 loc) · 2.09 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
82
83
84
85
86
87
88
89
90
91
module.exports = {
extends: 'airbnb-base',
overrides: [
// MJS files
{
env: {es6: true},
files: [
'lib/**/*.mjs',
],
parserOptions: {
allowImportExportEverywhere: true,
ecmaVersion: 9,
sourceType: 'module',
},
},
// JS files
{
files: [
'**/*.js',
],
parserOptions: {
sourceType: 'script',
},
},
// Jest tests
{
env: {
jest: true,
},
files: [
'**/*.test.{m,}js',
'**/test.{m,}js',
'**/test/**',
],
rules: {
'import/no-extraneous-dependencies': [
'error',
{ devDependencies: true },
],
/*
Prevent needlessly async tests.
*/
'require-await': 'error',
},
// TODO: Is this good practice, or should we require each package to declare jest, etc. as
// dev deps? ¯\_(ツ)_/¯
settings: {
'import/core-modules': [
'jest',
],
},
},
],
rules: {
'import/no-absolute-path': 'off',
/*
This rule gets in the way when writing a module that will contain multiple exports in the
future.
*/
'import/prefer-default-export': 'off',
/*
Seriously?
*/
'no-confusing-arrow': 'off',
/*
This is stupid.
*/
'no-continue': 'off',
/*
Can you imagine if they had to call it "C+=1"?
*/
'no-plusplus': 'off',
/*
Reading from process.env in Node is SLOW! It's fine to disable this rule for one-time setup
operations. The rule is enabled so we don't foolishly attempt to read from process.env inside
of a request handler.
*/
'no-process-env': 'error',
/*
AirBnB disables generators and async/await because of the runtime cost when transpiled to ES5,
but this isn't a concern when running JavaScript in Node instead of a browser.
*/
'no-restricted-syntax': 'off',
/*
We use Mongo.
*/
'no-underscore-dangle': ['error', { allow: ['_id', '_counter'] }],
'sort-keys': 'error',
},
};