-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
.eslintrc.json
78 lines (73 loc) · 2.82 KB
/
.eslintrc.json
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
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"airbnb-typescript"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint"
],
"ignorePatterns": [
"**/languages/*.json"
],
"rules": {
"@typescript-eslint/no-non-null-assertion": "off",
"linebreak-style": ["error", "unix"],
"@typescript-eslint/indent": ["error", 4],
"@typescript-eslint/comma-dangle": ["error", "never"],
// is not working very well, replace soon with https://typescript-eslint.io/rules/naming-convention/
"no-underscore-dangle": ["error", {
"allow": ["_containers", "_args", "_instance", "_isMouseDown", "_wrapper", "_lastHash", "_isHistoryOverriden", "_registeredCards" ], // allow static members, private (field) getters
"allowAfterThis": true,
"enforceInMethodNames": true,
"allowFunctionParams": false
}],
"@typescript-eslint/no-unused-expressions": ["error", { "allowShortCircuit":true }],
"@typescript-eslint/lines-between-class-members": "off",
"@typescript-eslint/keyword-spacing": ["error", {"overrides": { "this": { "before": false }}}],
"@typescript-eslint/explicit-member-accessibility": "error",
"@typescript-eslint/brace-style": ["error", "stroustrup"],
"react/jsx-filename-extension": "off",
"import/extensions": "off",
"import/no-extraneous-dependencies": "off",
// allow private empty ctor
"@typescript-eslint/no-empty-function": [
"error",
{
"allow": [
"functions",
"methods",
"private-constructors",
"protected-constructors"
]
}
],
// unused variables for interface
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_" // dont_throw unused on arguments starting with underscore
}
],
// no this. in static calls
"no-restricted-syntax": ["error", {
"selector": "MethodDefinition[static = true] ThisExpression",
"message": "this.member is prohibited for static members. Only ClassName.member is allowed."
}],
"@typescript-eslint/no-use-before-define": ["error", {
"functions": true,
"classes": false, // Allow use of classes defined under
"variables": true,
"allowNamedExports": false
}]
}
}