-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
108 lines (107 loc) · 3.25 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/* eslint sort-keys: "error" */
module.exports = {
env: {
browser: false,
es6: true,
node: true,
},
extends: [
"airbnb-base",
"prettier",
"prettier/@typescript-eslint",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},
overrides: [
{
files: ["*.test.ts"],
rules: {
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/require-await": 0,
"@typescript-eslint/tslint/config": [
"error",
{
lintFile: "./test/tslint.json",
},
],
"import/no-extraneous-dependencies": 0,
"max-lines-per-function": 0,
"max-nested-callbacks": 0,
"no-unused-expressions": 0,
},
},
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2019,
project: "./tsconfig.eslint.json",
sourceType: "module",
tsconfigRootDir: ".",
},
plugins: ["@typescript-eslint", "@typescript-eslint/tslint", "import"],
reportUnusedDisableDirectives: true,
root: true,
rules: {
"@typescript-eslint/camelcase": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
accessibility: "no-public",
overrides: {
parameterProperties: "off",
},
},
],
"@typescript-eslint/indent": 0,
"@typescript-eslint/interface-name-prefix": 0,
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-parameter-properties": 0,
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/no-use-before-define": ["error", { classes: true, functions: false }],
"@typescript-eslint/prefer-interface": 0,
"@typescript-eslint/prefer-nullish-coalescing": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
"@typescript-eslint/tslint/config": [
"error",
{
lintFile: "./tslint.json",
},
],
"complexity": ["warn", 10], // suck: 5, default: 20
"func-names": 0,
"import/extensions": 0,
"import/no-cycle": "error",
"import/no-extraneous-dependencies": ["error", { devDependencies: ["**/*.test.ts"] }],
"import/no-unresolved": 0,
"import/prefer-default-export": 0,
"lines-between-class-members": 0,
"max-classes-per-file": 0,
"max-depth": ["warn", 3], // suck: 3, default: 4
"max-lines": ["warn", 300], // suck: 200, angular: 400, default: 300
"max-lines-per-function": ["warn", 50], // suck: 20, angular: 75, default: 50
"max-nested-callbacks": ["warn", 2], // suck: 2, default: 10
"max-params": ["warn", 3], // suck: 2, default: 3
"no-await-in-loop": 0,
"no-console": 0,
"no-continue": 0,
"no-empty-function": ["error", { allow: ["constructors"] }],
"no-param-reassign": "error",
"no-plusplus": 0,
"no-restricted-syntax": 0,
"no-underscore-dangle": 0,
"no-useless-constructor": 0,
},
settings: {
"import/core-modules": ["telegram-typings"],
},
};