forked from CESNET/perun-web-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
103 lines (101 loc) · 3.87 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
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
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@angular-eslint/recommended"
],
"rules": {
// Eslint rules
"no-shadow": "off",
"no-unused-expressions": "off",
"no-restricted-imports": ["error", "rxjs/Rx"],
"eqeqeq": ["error", "smart"],
"no-console": ["error", { "allow": ["error"] }],
"no-throw-literal": "error",
"no-unused-vars": "error",
// Typescript rules
"@typescript-eslint/unbound-method": ["error", { "ignoreStatic": true }],
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/explicit-function-return-type": "error", // Perhaps too strict
"@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "no-public" }],
"@typescript-eslint/member-ordering": "error", // Can be configured, so we don't need to make so many changes, but still have consistency
"@typescript-eslint/no-base-to-string": "error",
"@typescript-eslint/no-confusing-non-null-assertion": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-optional-chain": "error", // Can have false positives so maybe remove this rule
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/no-shadow": ["error"],
"@typescript-eslint/no-unused-expressions": "error",
// Override rules from extensions to treat everything as error
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
// Disable formatting rules as formatting is handled by Prettier
"@typescript-eslint/no-extra-semi": "off",
// Naming conventions - variables, selectors
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE", "PascalCase"]
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "perun-web-apps",
"style": "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "perunWebApps",
"style": "camelCase"
}
],
// Angular rules
// Override rules from extensions to treat everything as error
"@angular-eslint/use-lifecycle-interface": "error",
// Nx rules
"@nx/enforce-module-boundaries": [
"error",
{
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
],
"enforceBuildableLibDependency": true
}
]
},
"plugins": ["eslint-plugin-import", "@angular-eslint/eslint-plugin", "@typescript-eslint"]
},
{
"files": ["*.html"],
"extends": ["plugin:@nx/angular-template"],
"rules": {
"@angular-eslint/template/banana-in-box": "error",
"@angular-eslint/template/eqeqeq": "error",
"@angular-eslint/template/no-negated-async": "error"
},
"plugins": ["@angular-eslint/eslint-plugin-template"]
}
]
}