forked from Jigsaw-Code/outline-apps
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.json
103 lines (103 loc) · 3.12 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
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:import/typescript"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "compat", "import"],
"rules": {
"compat/compat": "error",
"import/no-restricted-paths": [
"error",
{
"zones": [
// This means that in the src/infrastructure folder,
// you can't import any code,
// with the exception of other files within the src/infrastructure folder.
{
"target": "./src/infrastructure",
"from": ".",
"except": ["./src/infrastructure", "./node_modules"]
},
// Similar to above but for src/www/model, but you can use files from both the
// src/www/model and src/www/infrastructure paths.
{
"target": "./src/www/model",
"from": ".",
"except": ["./src/www/model", "./src/infrastructure", "./node_modules"]
},
// Prevents the internals of the outline_server_repository from being used publicly in the app.
{
"target": "./src/www/app/*.ts",
"from": "./src/www/app/outline_server_repository/server.ts"
},
{
"target": "./src/www/app/*.ts",
"from": "./src/www/app/outline_server_repository/access_key_serialization.ts"
},
{
"target": "./src/www/views",
"from": "./src/www/model"
},
{
"target": "./src/www/ui_components",
"from": "./src/www/model"
},
{
"target": "./src/www/views",
"from": "./src/www/app"
},
{
"target": "./src/www/ui_components",
"from": "./src/www/app"
}
]
}
],
"no-prototype-builtins": "off",
"prefer-const": "error",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/triple-slash-reference": "off"
},
"overrides": [
{
"files": ["*.spec.ts"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
},
// Turn off type-specific linting for pure javascript files.
{
"files": ["*.js", "*.mjs", "*.cjs"],
"extends": ["eslint:recommended"],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off"
}
},
// No need to check browser compatibility for electron files
{
"files": ["./src/www/app/electron_main.ts"],
"rules": {
"compat/compat": "off"
}
}
]
}