-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.json
88 lines (87 loc) · 2.86 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
{
"env": {
"browser": true,
"es2021": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["tsconfig.json"],
"ecmaVersion": "latest",
"sourceType": "module"
},
"overrides": [
{
"files": ["*.ts"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended",
"prettier"
],
"rules": {
"prettier/prettier": ["error"],
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-unused-vars": "off",
"no-prototype-builtins": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{ "vars": "all", "args": "none", "ignoreRestSiblings": false }
],
"explicit-module-boundary-types": "off",
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/member-ordering": [
"warn",
{
"default": [
"signature",
"public-field",
"protected-field",
"private-field",
"constructor",
"protected-method"
]
}
],
"@typescript-eslint/padding-line-between-statements": [
"error",
// import & export
{ "blankLine": "always", "prev": ["import", "export"], "next": "*" },
{ "blankLine": "never", "prev": "import", "next": "import" },
{ "blankLine": "never", "prev": "export", "next": "export" }
],
"@typescript-eslint/lines-between-class-members": [
"error",
"always",
{ "exceptAfterSingleLine": true }
],
// added to allow reactive forms validator reference
// » https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/unbound-method.md#ignorestatic
"@typescript-eslint/unbound-method": [
"error",
{
"ignoreStatic": true
}
],
"brace-style": ["error", "1tbs", { "allowSingleLine": false }],
"curly": "error"
}
},
// @see https://itnext.io/configure-prettier-and-eslint-with-angular-e7b4ce979cd8
// NOTE: WE ARE NOT APPLYING PRETTIER IN THIS OVERRIDE, ONLY @ANGULAR-ESLINT/TEMPLATE
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {}
},
// NOTE: WE ARE NOT APPLYING @ANGULAR-ESLINT/TEMPLATE IN THIS OVERRIDE, ONLY PRETTIER
{
"files": ["*.html"],
"extends": ["plugin:prettier/recommended"],
"rules": {
// NOTE: WE ARE OVERRIDING THE DEFAULT CONFIG TO ALWAYS SET THE PARSER TO ANGULAR (SEE BELOW)
"prettier/prettier": ["error", { "endOfLine": "auto", "parser": "angular" }]
}
}
]
}