-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.json
61 lines (61 loc) · 1.51 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
{
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parserOptions": {
"project": "./tsconfig.json",
"sourceType": "module"
},
"ignorePatterns": ["widgets/*/public/*.js"],
"plugins": ["@typescript-eslint"],
"settings": {
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"project": "./tsconfig.json"
}
}
},
"rules": {
"no-unused-vars": "off", // Disable the base rule as it can report incorrect errors
"@typescript-eslint/no-unused-vars": [
// Error on unused variables
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
"@typescript-eslint/explicit-function-return-type": "error", // Enforce explicit return type
"@typescript-eslint/no-floating-promises": "error", // Enforce awaiting async functions,
"@typescript-eslint/no-explicit-any": "warn", // Warn on explicit any
"indent": ["error", "tab", { "SwitchCase": 1 }],
"@typescript-eslint/naming-convention": "error" // Enforce naming conventions
},
"overrides": [
{
"files": ["constants.mts"],
"rules": {
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "enum",
"format": ["UPPER_CASE"]
},
{
"selector": "enumMember",
"format": ["UPPER_CASE"]
},
{
"selector": "variable",
"modifiers": ["const"],
"format": ["UPPER_CASE"],
"filter": {
"regex": "^DATAVISTA_",
"match": true
}
}
]
}
}
]
}