forked from abreits/amqp-ts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
84 lines (84 loc) · 2.42 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
module.exports = {
env: { node: true },
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 9,
sourceType: "module",
tsConfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier",
"plugin:node/recommended-module",
],
ignorePatterns: ["coverage", "lib", "test/__test", "tools/alive.js", "tutorials/**/*.js", ".eslintrc.js"],
settings: {
node: {
tryExtensions: [".js", ".json", ".node", ".ts"],
},
},
rules: {
"comma-dangle": ["error", "always-multiline"],
"dot-notation": ["error"],
"max-classes-per-file": ["error", 1],
"max-len": ["warn", { code: 120 }],
"no-console": "error",
"@typescript-eslint/naming-convention": [
"warn",
{
selector: "interface",
format: ["PascalCase"],
custom: {
regex: "^I[A-Z]",
match: false,
},
},
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
vars: "all",
args: "all",
argsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-floating-promises": ["off"],
},
overrides: [
{
files: ["tutorials/**/**"],
rules: {
"no-var-requires": "off",
"no-console": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"no-undef": "off"
},
},
{
files: ["test/**/*"],
env: { mocha: true },
extends: ["plugin:mocha/recommended"],
parserOptions: { project: "test/tsconfig.json" },
plugins: ["mocha"],
rules: {
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/no-empty-function": "off",
"dot-notation": ["off"],
},
},
],
};