-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
59 lines (49 loc) · 1.67 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
module.exports = {
parser: '@typescript-eslint/parser',
extends: ['airbnb-base', 'prettier'],
plugins: ['@typescript-eslint', 'prettier'],
settings: {
'import/resolver': {
node: {
extensions: ['.mjs', '.js', '.json', '.ts'],
},
},
'import/extensions': ['.js', '.mjs', '.jsx', '.ts', '.tsx'],
},
parserOptions: {
project: ['./tsconfig.eslint.json'],
tsconfigRootDir: __dirname,
},
rules: {
// Let typescript compiler handle this
'no-unused-vars': 'off',
'typescript/no-unused-vars': 'off',
// Catch common async/await problems
'@typescript-eslint/no-misused-promises': 2,
'@typescript-eslint/no-floating-promises': [2, { ignoreIIFE: true }],
'@typescript-eslint/promise-function-async': 2,
// originally required in the early days of monorepos -- consider revisiting
'import/no-cycle': 'off',
// prettier is handling this
'max-len': 'off',
// our loop iterations are rarely independent, and it's a more readable syntax
'no-await-in-loop': 'off',
// we almost never do default exports
'import/prefer-default-export': 'off',
// artifact of the Flow days, imports were indeed duplicated because types had to be separate
'import/no-duplicates': 'off',
// Just migrated to Node 16, not ready for this undertaking
'import/extensions': 'off',
// relax this to avoid unnecessary temp variables
'no-param-reassign': [
2,
{
props: false,
},
],
// unhappy with our one-liner Promise constructor arrow functions
'no-promise-executor-return': 'off',
// prettier issues are warnings here
'prettier/prettier': 'warn',
},
};