-
Notifications
You must be signed in to change notification settings - Fork 52
/
.eslintrc.js
65 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
module.exports = {
env: {
browser: false,
es2021: true,
mocha: true,
node: true,
},
plugins: ["node", "prettier", "@typescript-eslint", "mocha", "chai-expect"],
extends: [
"plugin:prettier/recommended",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:node/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 12,
project: "./tsconfig.eslint.json",
},
rules: {
"prettier/prettier": ["warn"],
indent: 0, // avoid conflict with prettier's indent system
"linebreak-style": ["error", "unix"],
quotes: ["error", "double", { avoidEscape: true }],
semi: ["error", "always"],
curly: ["error", "all"],
"spaced-comment": ["error", "always", { exceptions: ["-", "+"] }],
"no-console": 2,
camelcase: "off",
"@typescript-eslint/camelcase": "off",
"mocha/no-exclusive-tests": "error",
"@typescript-eslint/no-var-requires": "off",
"node/no-unsupported-features/es-syntax": ["error", { ignores: ["modules"] }],
// Disable warnings for { a, b, ...rest } variables, since this is typically used to remove variables.
"@typescript-eslint/no-unused-vars": ["error", { ignoreRestSiblings: true }],
"chai-expect/missing-assertion": 2,
"no-duplicate-imports": "error",
"@typescript-eslint/no-floating-promises": ["error"],
"@typescript-eslint/no-misused-promises": ["error", { checksVoidReturn: false }],
"no-restricted-imports": [
"error",
{
patterns: [{ group: ["@ethersproject/bignumber"], message: "Use 'src/utils/BNUtils' instead" }],
paths: [
{ name: "ethers", importNames: ["BigNumber"], message: "Use 'src/utils/BNUtils' instead" },
{ name: "ethers", importNames: ["Event"], message: "Use Log from 'src/interfaces/Common' instead" },
],
},
],
},
settings: {
node: {
tryExtensions: [".js", ".ts"],
},
},
overrides: [
{
files: ["scripts/*.ts", "tasks/*.ts", "src/scripts/*.ts"],
rules: {
"no-console": 0,
},
},
],
};