This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
/
.eslintrc
56 lines (54 loc) · 2.24 KB
/
.eslintrc
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
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json"]
},
"plugins": ["@typescript-eslint"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"rules": {
"arrow-body-style": ["error", "as-needed"], // Allow single-line arrow functions without braces
"prefer-arrow-callback": ["error", { "allowNamedFunctions": false }], // Allow arrow functions for callbacks
"func-style": ["error", "declaration", { "allowArrowFunctions": false }], // Enforce function declarations and named functions
// ... other rules ...
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/naming-convention": [
"error",
{ "selector": "typeLike", "format": ["PascalCase"] },
{ "selector": "variableLike", "format": ["camelCase"] },
{ "selector": "memberLike", "modifiers": ["private"], "format": ["camelCase"], "leadingUnderscore": "require" },
{
"selector": "variable",
"types": ["boolean"],
"format": ["PascalCase"],
"prefix": ["is", "should", "has", "can", "did", "will", "does"]
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"],
"leadingUnderscore": "allow",
"trailingUnderscore": "allow"
},
{ "selector": "typeParameter", "format": ["PascalCase"], "prefix": ["T"] },
{ "selector": "interface", "format": ["PascalCase"], "custom": { "regex": "^I[A-Z]", "match": false } },
{ "selector": ["function", "variable"], "format": ["camelCase"] },
{ "selector": "variable", "modifiers": ["destructured"], "format": null },
{ "selector": "variable", "format": ["camelCase"], "leadingUnderscore": "allow", "trailingUnderscore": "allow" },
{
"selector": "parameter",
"format": ["camelCase"],
"leadingUnderscore": "allow", // This allows the use of a leading underscore
"trailingUnderscore": "allow" // This allows the use of a trailing underscore
},
{
"selector": "parameter",
"format": null,
"filter": {
// This allows parameters to be named as just an underscore
"regex": "^_$",
"match": true
}
}
]
}
}