-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
59 lines (59 loc) · 1.59 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 = {
env: {
browser: false,
es2021: true,
mocha: true,
node: true,
},
plugins: ['@typescript-eslint', 'prettier'],
extends: ['plugin:node/recommended', 'airbnb-base', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
project: './tsconfig.json',
},
rules: {
// Flag usages of ECMAScript that our Node.js version isn't compatible with
'node/no-unsupported-features/es-syntax': [
'error',
{
ignores: ['modules'],
},
],
// Allow importing devDependencies like ethers in non-test files
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
},
],
// Disable flagging missing imports
'node/no-missing-import': ['off'],
// Warn when lines are >120 characters
'max-len': [
'warn',
{
code: 120,
ignoreUrls: true,
},
],
// Allow multi-line strings (we don't care about older versions before ES5)
'no-multi-str': ['off'],
// It doesn't recognize when "directory/index.ts" and we're importing "directory", so we turn it off
'import/extensions': ['off'],
// Flag prettier warnings
'prettier/prettier': ['warn'],
// We print to console quite a bit intentionally
'no-console': 'off',
// Some best practices slow down development and should be warnings instead of errors
'no-unused-vars': 'warn',
'spaced-comment': 'warn',
'no-useless-return': 'warn',
'no-empty': 'warn',
},
settings: {
'import/resolver': {
typescript: {},
},
},
};